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
1 changed files with 1 additions and 1 deletions

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 // Otherwise, PA will keep hammering us for underruns (which it does instead
// of stopping the stream automatically). // of stopping the stream automatically).
if (!state->playing) if (!state->playing)
cork(ao, true); reset(ao);
} }
/* A callback function that is called when the /* A callback function that is called when the