output/pulse: don't drain if stream is suspended or corked

In this state, we can't make any progress.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1084
This commit is contained in:
Max Kellermann 2021-02-15 16:02:01 +01:00
parent c2bc3704e1
commit f1b8bcd6b2
2 changed files with 4 additions and 1 deletions

1
NEWS
View File

@ -5,6 +5,7 @@ ver 0.22.5 (not yet released)
- iso9660: another fix for unaligned reads
* output
- httpd: error handling on Windows improved
- pulse: fix deadlock with "always_on"
* Windows:
- enable https:// support (via Schannel)

View File

@ -830,7 +830,9 @@ PulseOutput::Drain()
{
Pulse::LockGuard lock(mainloop);
if (pa_stream_get_state(stream) != PA_STREAM_READY)
if (pa_stream_get_state(stream) != PA_STREAM_READY ||
pa_stream_is_suspended(stream) ||
pa_stream_is_corked(stream))
return;
pa_operation *o =