diff options
author | wm4 <wm4@nowhere> | 2015-05-19 21:33:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-19 21:33:48 +0200 |
commit | 10915000fbb0d3a5531f7dcfe9428c15a0508680 (patch) | |
tree | 6a9989b867e6e6fcd79f31e94db7cdf835c235ac | |
parent | 0c84f6e820315fe40c85b4bc9a375c341b16e507 (diff) |
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.
-rw-r--r-- | player/audio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/player/audio.c b/player/audio.c index ea729ce2cc..7691b32563 100644 --- a/player/audio.c +++ b/player/audio.c @@ -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 } |