From 468b6f1d1baa6708c8c43ddd4117a3f994f43409 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Sun, 12 Jul 2026 20:36:18 +0800 Subject: [PATCH] Fix playback backup timer interval and waveform-only prequeue - The playback backup timer was using timebase_dbl() in seconds as its QTimer interval, which truncated to 0 ms for normal frame rates. This caused the timer to fire continuously and starve the event loop when the video display was hidden, e.g. in Show Waveform Only mode, freezing the UI and stopping the playhead. Multiply by 1000 to use milliseconds. - If PlayInternal has neither video nor audio to prequeue, call FinishPlayPreprocess immediately so the backup timer starts and the playhead advances even in waveform-only mode with no audio. --- app/widget/viewer/viewer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/widget/viewer/viewer.cpp b/app/widget/viewer/viewer.cpp index a3bb443c9..5308c53c8 100644 --- a/app/widget/viewer/viewer.cpp +++ b/app/widget/viewer/viewer.cpp @@ -1146,6 +1146,12 @@ void ViewerWidget::PlayInternal(int speed, bool in_to_out_only) } } + // If there's nothing to prequeue, start playback immediately so the + // playhead advances even when only the audio waveform is visible. + if (!prequeuing_video_ && !prequeuing_audio_) { + FinishPlayPreprocess(); + } + // Force screen to stay awake PreventSleep(true); } @@ -1388,7 +1394,8 @@ void ViewerWidget::FinishPlayPreprocess() } // This is our timer for loading the queue and setting the time - playback_backup_timer_.setInterval(qFloor(timebase_dbl())); + playback_backup_timer_.setInterval( + qMax(1, qFloor(timebase_dbl() * 1000.0))); playback_backup_timer_.start(); PlaybackTimerUpdate();