aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_internal.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-29 17:06:40 +0100
committerMax Kellermann <max@duempel.org>2009-10-29 17:06:40 +0100
commitbde3d1433997af8cc430f4b9d38e5bde97d3b760 (patch)
tree59ed180c3d0bf9f7b37065eea3fa13d7ffd72286 /src/output_internal.h
parent1403172ef397c3dfc58a64c999a362cca977241b (diff)
downloadmpd-bde3d1433997af8cc430f4b9d38e5bde97d3b760.tar.gz
mpd-bde3d1433997af8cc430f4b9d38e5bde97d3b760.tar.xz
mpd-bde3d1433997af8cc430f4b9d38e5bde97d3b760.zip
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.
Diffstat (limited to '')
-rw-r--r--src/output_internal.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/output_internal.h b/src/output_internal.h
index 0c25348a0..6b81bbc78 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 <glib.h>
#include <time.h>
@@ -141,11 +142,6 @@ struct audio_output {
GThread *thread;
/**
- * Notify object for the thread.
- */
- struct notify notify;
-
- /**
* The next command to be performed by the output thread.
*/
enum audio_output_command command;
@@ -161,6 +157,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
* #music_buffer, because they are not going to be used by