output: protect audio_output.open with the mutex
There was a deadlock between the output thread and the player thread: when the output thread failed (and closed itself) while the player thread worked with the audio_output object, MPD could crash.
This commit is contained in:
@@ -65,6 +65,11 @@ struct audio_output {
|
||||
|
||||
/**
|
||||
* Is the device (already) open and functional?
|
||||
*
|
||||
* This attribute may only be modified by the output thread.
|
||||
* It is protected with #mutex: write accesses inside the
|
||||
* output thread and read accesses outside of it may only be
|
||||
* performed while the lock is held.
|
||||
*/
|
||||
bool open;
|
||||
|
||||
@@ -113,7 +118,7 @@ struct audio_output {
|
||||
const struct music_pipe *pipe;
|
||||
|
||||
/**
|
||||
* This mutex protects #chunk and #chunk_finished.
|
||||
* This mutex protects #open, #chunk and #chunk_finished.
|
||||
*/
|
||||
GMutex *mutex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user