swaroop: fix up restart-after-crash.
[dcpomatic.git] / src / wx / film_viewer.cc
index 66b919a7588d72aaa2f55444860bc8fedc6aaad7..90f8c9fd2d885c20c974c13eb96835ade8b6866f 100644 (file)
@@ -121,8 +121,9 @@ FilmViewer::set_film (shared_ptr<Film> film)
        }
 
        _film = film;
-
-       FilmChanged ();
+       _video_position = DCPTime ();
+       _player_video.first.reset ();
+       _player_video.second = DCPTime ();
 
        _frame.reset ();
        _closed_captions_dialog->clear ();
@@ -297,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);