mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
audio: avoid wasting CPU due to continuous wakeup
Thsi code path happens during seeking. If video is still being decoded to get to the first video frame, audio has nothing to do, as it is synchronized against the first video frame. We only want to wake up if there's an actual state change. Fixes #1958.
This commit is contained in:
@@ -527,7 +527,8 @@ static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
|
||||
mpctx->audio_status = STATUS_FILLING;
|
||||
if (status != AD_OK && !mp_audio_buffer_samples(mpctx->ao_buffer))
|
||||
mpctx->audio_status = STATUS_EOF;
|
||||
mpctx->sleeptime = 0;
|
||||
if (mpctx->audio_status != STATUS_SYNCING)
|
||||
mpctx->sleeptime = 0;
|
||||
return; // continue on next iteration
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user