From 5617521380be296617e678ffb69468e4914618d0 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Sat, 6 Aug 2016 15:25:58 +0200 Subject: [PATCH] Must lock/unlock around wait --- src/output/plugins/OSXOutputPlugin.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index 2da3af9f6..553537eae 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -614,6 +614,7 @@ osx_output_play(AudioOutput *ao, const void *chunk, size_t size, { OSXOutput *od = (OSXOutput *)ao; + od->mutex.lock(); while (true) { if (od->ring_buffer->write_available() > 0) break; @@ -621,6 +622,7 @@ osx_output_play(AudioOutput *ao, const void *chunk, size_t size, /* wait for some free space in the buffer */ od->condition.wait(od->mutex); } + od->mutex.unlock(); return od->ring_buffer->push((uint8_t *) chunk, size); }