diff options
author | Max Kellermann <max@duempel.org> | 2009-10-21 08:07:07 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-10-21 08:07:07 +0200 |
commit | 1a6ed811935916b8cc27d9eeb7f3be3413e643f7 (patch) | |
tree | 4ec1dcdec2885a8ef6446db0c14298d92a06d059 /src/output | |
parent | b2b300b6353fad372e78b14c36dea719e2da22ca (diff) | |
download | mpd-1a6ed811935916b8cc27d9eeb7f3be3413e643f7.tar.gz mpd-1a6ed811935916b8cc27d9eeb7f3be3413e643f7.tar.xz mpd-1a6ed811935916b8cc27d9eeb7f3be3413e643f7.zip |
output_thread: check again if output is open on PAUSE
Basically the same as the 0.15.5 patch "check again if output is open
on CANCEL". Same race condition, same fix.
Diffstat (limited to '')
-rw-r--r-- | src/output_thread.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/output_thread.c b/src/output_thread.c index 9ca844623..770b377e8 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -248,6 +248,15 @@ static gpointer audio_output_task(gpointer arg) break; case AO_COMMAND_PAUSE: + if (!ao->open) { + /* the output has failed after + audio_output_all_pause() has + submitted the PAUSE command; bail + out */ + ao_command_finished(ao); + break; + } + ao_pause(ao); /* don't "break" here: this might cause ao_play() to be called when command==CLOSE |