From: Carl Hetherington Date: Mon, 25 Nov 2019 23:32:37 +0000 (+0100) Subject: Fix problems when starting to play after a seek, if the start X-Git-Tag: v2.15.40^2~3 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=0b21bfba60be812a5d04cc5c10868e04b5579404 Fix problems when starting to play after a seek, if the start of playback happens while we are awaiting an idle handler to go through to update the view after the seek. If this idle handler has not gone through the viewer will report an incorrect position, which is used by the FilmViewer to start the audio stream at the wrong time. --- diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 704088645..3a593fc55 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -314,6 +314,14 @@ FilmViewer::start () return; } + /* We are about to set up the audio stream from the position of the video view. + If there is `lazy' seek in progress we need to wait for it to go through so that + _video_view->position() gives us a sensible answer. + */ + while (_idle_get) { + idle_handler (); + } + if (_audio.isStreamOpen()) { _audio.setStreamTime (_video_view->position().seconds()); _audio.startStream ();