summaryrefslogtreecommitdiff
path: root/src/wx/video_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-23 01:52:21 +0100
committerCarl Hetherington <cth@carlh.net>2020-12-23 01:52:21 +0100
commit6516fb170b0e7a83c582a858fb54d1f83f751cc0 (patch)
tree2182093659f83d482352e844c2170dd3c550a15a /src/wx/video_view.cc
parente026ba2c11f16fe2d486acdd489050538e66fece (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/video_view.cc')
-rw-r--r--src/wx/video_view.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc
index 36dbef93a..7805a1fb3 100644
--- a/src/wx/video_view.cc
+++ b/src/wx/video_view.cc
@@ -52,18 +52,19 @@ VideoView::clear ()
/** Could be called from any thread.
* @param non_blocking true to return false quickly if no video is available quickly.
- * @return false if we gave up because it would take too long, otherwise true.
+ * @return FAIL if there's no frame, AGAIN if the method should be called again, or SUCCESS
+ * if there is a frame.
*/
-bool
+VideoView::NextFrameResult
VideoView::get_next_frame (bool non_blocking)
{
if (length() == dcpomatic::DCPTime()) {
- return true;
+ return FAIL;
}
shared_ptr<Butler> butler = _viewer->butler ();
if (!butler) {
- return false;
+ return FAIL;
}
add_get ();
@@ -75,8 +76,8 @@ VideoView::get_next_frame (bool non_blocking)
if (e.code == Butler::Error::DIED) {
LOG_ERROR ("Butler died with %1", e.summary());
}
- if (!pv.first && e.code == Butler::Error::AGAIN) {
- return false;
+ if (!pv.first) {
+ return e.code == Butler::Error::AGAIN ? AGAIN : FAIL;
}
_player_video = pv;
} while (
@@ -90,7 +91,7 @@ VideoView::get_next_frame (bool non_blocking)
++_errored;
}
- return true;
+ return SUCCESS;
}
dcpomatic::DCPTime