summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-04-18 10:57:19 +0100
committerCarl Hetherington <cth@carlh.net>2017-04-19 23:04:32 +0100
commit575c1882e0b06ee7569d93686440a3bdcf655d58 (patch)
treef6d6f810f0d82e1c6c23edbf06734e604b3904a7 /src
parent9e58ca88bdb5a108cb7b2adedb2aa54e620e7cd2 (diff)
Fix video timing and stop the viewer at the end of the film.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_viewer.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 2aef50c6d..56f9c15e8 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -306,11 +306,15 @@ FilmViewer::timer ()
}
if (_audio.isStreamRunning ()) {
- DCPTime const now = time().ceil (_film->video_frame_rate ());
get ();
update_position_label ();
update_position_slider ();
- DCPTime const next = now + DCPTime::from_frames (1, _film->video_frame_rate ());
+ DCPTime const next = _video_position + DCPTime::from_frames (1, _film->video_frame_rate ());
+
+ if (next >= _film->length()) {
+ stop ();
+ }
+
_timer.Start (max ((next.seconds() - time().seconds()) * 1000, 0.0), wxTIMER_ONE_SHOT);
}