viewer: fixed issue that would cause playback queue to stall

This commit is contained in:
itsmattkc
2020-05-09 16:21:03 +10:00
parent 0340373faa
commit 20ef7b1c21
+8 -5
View File
@@ -352,6 +352,7 @@ void ViewerWidget::UpdateTextureFromNode(const rational& time)
{ {
{ {
QMutexLocker locker(playback_queue_.lock()); QMutexLocker locker(playback_queue_.lock());
while (!playback_queue_.isEmpty()) { while (!playback_queue_.isEmpty()) {
const ViewerPlaybackFrame& pf = playback_queue_.first(); const ViewerPlaybackFrame& pf = playback_queue_.first();
@@ -400,11 +401,15 @@ void ViewerWidget::PlayInternal(int speed, bool in_to_out_only)
playback_speed_); playback_speed_);
} }
playback_queue_next_frame_ = ruler()->GetTime(); int64_t start_time = ruler()->GetTime();
playback_timer_.Start(playback_queue_next_frame_, playback_speed_, timebase_dbl());
playback_queue_next_frame_ = start_time;
FillPlaybackQueue();
playback_timer_.Start(start_time, playback_speed_, timebase_dbl());
foreach (ViewerWindow* window, windows_) { foreach (ViewerWindow* window, windows_) {
window->Play(playback_queue_next_frame_, playback_speed_, timebase()); window->Play(start_time, playback_speed_, timebase());
} }
controls_->ShowPauseButton(); controls_->ShowPauseButton();
@@ -416,8 +421,6 @@ void ViewerWidget::PlayInternal(int speed, bool in_to_out_only)
} else { } else {
connect(display_widget_, &ViewerDisplayWidget::frameSwapped, this, &ViewerWidget::PlaybackTimerUpdate); connect(display_widget_, &ViewerDisplayWidget::frameSwapped, this, &ViewerWidget::PlaybackTimerUpdate);
} }
FillPlaybackQueue();
} }
void ViewerWidget::PushScrubbedAudio() void ViewerWidget::PushScrubbedAudio()