summaryrefslogtreecommitdiff
path: root/src/wx/video_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-11-20 21:25:55 +0100
committerCarl Hetherington <cth@carlh.net>2020-01-08 21:56:47 +0100
commit4f7e9f125716a27ed9e2a8e30f067100cbee773a (patch)
tree40238a1414cc4d96675cf8a27fe4e1ab328d5480 /src/wx/video_view.cc
parent5ee3fcbd31065275faad4c06a7805dcbcb338812 (diff)
Fix display when there is no film.
Diffstat (limited to 'src/wx/video_view.cc')
-rw-r--r--src/wx/video_view.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc
index f2886a48c..f8d44dc70 100644
--- a/src/wx/video_view.cc
+++ b/src/wx/video_view.cc
@@ -37,6 +37,10 @@ VideoView::clear ()
bool
VideoView::get_next_frame (bool non_blocking)
{
+ if (_length == dcpomatic::DCPTime()) {
+ return true;
+ }
+
DCPOMATIC_ASSERT (_viewer->butler());
_viewer->_gets++;
@@ -71,13 +75,17 @@ VideoView::one_video_frame () const
return dcpomatic::DCPTime::from_frames (1, video_frame_rate());
}
-/* XXX_b: comment */
+/** @return Time in ms until the next frame is due */
int
VideoView::time_until_next_frame () const
{
+ if (length() == dcpomatic::DCPTime()) {
+ /* There's no content, so this doesn't matter */
+ return 0;
+ }
+
dcpomatic::DCPTime const next = position() + one_video_frame();
dcpomatic::DCPTime const time = _viewer->audio_time().get_value_or(position());
- std::cout << to_string(next) << " " << to_string(time) << " " << ((next.seconds() - time.seconds()) * 1000) << "\n";
if (next < time) {
return 0;
}