0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

audio/out: prevent burning CPU when seeking while paused

The audio/video sync code in player/audio.c calls ao_reset() each time
audio decoding is entered, but the player is paused, and there would be
more than 1 sample to skip to make audio start match with video start.
This caused a wakeup feedback loop with push.c.

CC: @mpv-player/stable
This commit is contained in:
wm4 2014-08-31 14:38:47 +02:00
parent 64b7811c28
commit 8432eaefa0

View File

@ -319,7 +319,8 @@ static void *playthread(void *arg)
// The most important part is that the decoder is woken up, so
// that the decoder will wake up us in turn.
MP_TRACE(ao, "buffer inactive.\n");
mp_input_wakeup(ao->input_ctx);
if (!p->requested_data)
mp_input_wakeup(ao->input_ctx);
pthread_cond_wait(&p->wakeup, &p->lock);
} else {
if (!ao->driver->wait || ao->driver->wait(ao, &p->lock) < 0) {