From bde3d1433997af8cc430f4b9d38e5bde97d3b760 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 29 Oct 2009 17:06:40 +0100 Subject: output: consistently lock audio output objects Always keep the audio_output object locked within the output thread, unless a plugin method is called. This fixes several race conditions. --- src/output_internal.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/output_internal.h') diff --git a/src/output_internal.h b/src/output_internal.h index 0c25348a..6b81bbc7 100644 --- a/src/output_internal.h +++ b/src/output_internal.h @@ -21,7 +21,8 @@ #define MPD_OUTPUT_INTERNAL_H #include "audio_format.h" -#include "notify.h" + +#include #include @@ -140,11 +141,6 @@ struct audio_output { */ GThread *thread; - /** - * Notify object for the thread. - */ - struct notify notify; - /** * The next command to be performed by the output thread. */ @@ -160,6 +156,12 @@ struct audio_output { */ GMutex *mutex; + /** + * This condition object wakes up the output thread after + * #command has been set. + */ + GCond *cond; + /** * The #music_chunk which is currently being played. All * chunks before this one may be returned to the -- cgit v1.2.3