swaroop: fix up restart-after-crash.
[dcpomatic.git] / src / wx / film_viewer.cc
index 35b0663b0fd10b596dd73d4f1ce18c26abdf519f..90f8c9fd2d885c20c974c13eb96835ade8b6866f 100644 (file)
@@ -121,6 +121,9 @@ FilmViewer::set_film (shared_ptr<Film> film)
        }
 
        _film = film;
+       _video_position = DCPTime ();
+       _player_video.first.reset ();
+       _player_video.second = DCPTime ();
 
        _frame.reset ();
        _closed_captions_dialog->clear ();
@@ -295,6 +298,8 @@ FilmViewer::timer ()
 
        if (next >= _film->length()) {
                stop ();
+               Finished ();
+               return;
        }
 
        _timer.Start (max ((next.seconds() - time().seconds()) * 1000, 1.0), wxTIMER_ONE_SHOT);
@@ -636,7 +641,6 @@ FilmViewer::config_changed (Config::Property p)
                }
 
                _audio_channels = _audio.getDeviceInfo(st).outputChannels;
-               cout << "RtAudio reports " << _audio_channels << " channels.\n";
 
                RtAudio::StreamParameters sp;
                sp.deviceId = st;