1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 01:52:19 +00:00

ao/pulse: flush stream on underrun

The underflow callback introduced in d27ad96 can be called
when the buffer is still full, causing playback to never
resume afterwards since get_state() reports free_samples == 0.
Fix this by fully resetting on underrun, which flushes
the stream and ensures free buffer space.

fixes #7874
This commit is contained in:
sfan5 2020-07-11 00:16:53 +02:00
parent c82abb3a65
commit f3b29a680c

View File

@ -635,7 +635,7 @@ static void audio_get_state(struct ao *ao, struct mp_pcm_state *state)
// Otherwise, PA will keep hammering us for underruns (which it does instead
// of stopping the stream automatically).
if (!state->playing)
cork(ao, true);
reset(ao);
}
/* A callback function that is called when the