diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-23 01:52:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-23 01:52:21 +0100 |
| commit | 6516fb170b0e7a83c582a858fb54d1f83f751cc0 (patch) | |
| tree | 2182093659f83d482352e844c2170dd3c550a15a /src/wx/film_viewer.cc | |
| parent | e026ba2c11f16fe2d486acdd489050538e66fece (diff) | |
Various tweaks to fix playback at the end of a film (#1858).
The most questionable change here is probably how
SimpleVideoView::display_next_frame no longer re-schedules
itself if the call to get_next_frame returned AGAIN; it seems
wrong to do that when FilmViewer::idle_handler() also reschedules
itself when display_next_frame() returns AGAIN.
Diffstat (limited to 'src/wx/film_viewer.cc')
| -rw-r--r-- | src/wx/film_viewer.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 7adf2ba2d..920ca3a10 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -137,11 +137,11 @@ FilmViewer::idle_handler () return; } - if (_video_view->display_next_frame(true)) { - _idle_get = false; - } else { + if (_video_view->display_next_frame(true) == VideoView::AGAIN) { /* get() could not complete quickly so we'll try again later */ signal_manager->when_idle (boost::bind(&FilmViewer::idle_handler, this)); + } else { + _idle_get = false; } } @@ -346,8 +346,11 @@ FilmViewer::start () } _playing = true; - _video_view->start (); + /* Calling start() below may directly result in Stopped being emitted, and if that + * happens we want it to come after the Started signal, so do that first. + */ Started (position()); + _video_view->start (); } bool @@ -496,7 +499,7 @@ FilmViewer::seek (DCPTime t, bool accurate) /* We're going to start playing again straight away so wait for the seek to finish. */ - while (!_video_view->display_next_frame(false)) {} + while (_video_view->display_next_frame(false) == VideoView::AGAIN) {} } resume (); |
