output_thread: reimplement CANCEL synchronization
The output thread could hang indefinitely after finishing CANCEL, because it could have missed the signal while the output was not unlocked in ao_command_finished(). This patch removes the wait() call after CANCEL, and adds the flag "allow_play" instead. While this flag is set, playback is skipped. With this flag, there will not be any excess wait() call after the pipe has been cleared. This patch fixes a bug that causes mpd to discontinue playback after seeking, due to the race condition described above.
This commit is contained in:
@@ -189,6 +189,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
|
||||
ao->really_enabled = false;
|
||||
ao->open = false;
|
||||
ao->pause = false;
|
||||
ao->allow_play = true;
|
||||
ao->fail_timer = NULL;
|
||||
|
||||
pcm_buffer_init(&ao->cross_fade_buffer);
|
||||
|
Reference in New Issue
Block a user