summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);
}