e28271bff4
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@2776 6952d904-891a-0410-993b-d76249ca496b
169 lines
3.8 KiB
Diff
169 lines
3.8 KiB
Diff
a8103fa pulse: Don't lock the mainloop in NULL
|
|
ext/pulse/pulsesink.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-
|
|
ext/pulse/pulsesrc.c | 9 ++++++++
|
|
2 files changed, 58 insertions(+), 1 deletions(-)
|
|
|
|
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
|
|
index e39b672..8d5f0fe 100644
|
|
--- a/ext/pulse/pulsesink.c
|
|
+++ b/ext/pulse/pulsesink.c
|
|
@@ -1692,6 +1692,9 @@ gst_pulsesink_set_volume (GstPulseSink * psink, gdouble volume)
|
|
GstPulseRingBuffer *pbuf;
|
|
uint32_t idx;
|
|
|
|
+ if (!psink->mainloop)
|
|
+ goto no_mainloop;
|
|
+
|
|
pa_threaded_mainloop_lock (psink->mainloop);
|
|
|
|
GST_DEBUG_OBJECT (psink, "setting volume to %f", volume);
|
|
@@ -1720,6 +1723,14 @@ unlock:
|
|
return;
|
|
|
|
/* ERRORS */
|
|
+no_mainloop:
|
|
+ {
|
|
+ psink->volume = volume;
|
|
+ psink->volume_set = TRUE;
|
|
+
|
|
+ GST_DEBUG_OBJECT (psink, "we have no mainloop");
|
|
+ return;
|
|
+ }
|
|
no_buffer:
|
|
{
|
|
psink->volume = volume;
|
|
@@ -1749,6 +1760,9 @@ gst_pulsesink_set_mute (GstPulseSink * psink, gboolean mute)
|
|
GstPulseRingBuffer *pbuf;
|
|
uint32_t idx;
|
|
|
|
+ if (!psink->mainloop)
|
|
+ goto no_mainloop;
|
|
+
|
|
pa_threaded_mainloop_lock (psink->mainloop);
|
|
|
|
GST_DEBUG_OBJECT (psink, "setting mute state to %d", mute);
|
|
@@ -1775,6 +1789,14 @@ unlock:
|
|
return;
|
|
|
|
/* ERRORS */
|
|
+no_mainloop:
|
|
+ {
|
|
+ psink->mute = mute;
|
|
+ psink->mute_set = TRUE;
|
|
+
|
|
+ GST_DEBUG_OBJECT (psink, "we have no mainloop");
|
|
+ return;
|
|
+ }
|
|
no_buffer:
|
|
{
|
|
psink->mute = mute;
|
|
@@ -1833,6 +1855,9 @@ gst_pulsesink_get_volume (GstPulseSink * psink)
|
|
gdouble v = DEFAULT_VOLUME;
|
|
uint32_t idx;
|
|
|
|
+ if (!psink->mainloop)
|
|
+ goto no_mainloop;
|
|
+
|
|
pa_threaded_mainloop_lock (psink->mainloop);
|
|
|
|
pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
|
|
@@ -1852,9 +1877,9 @@ gst_pulsesink_get_volume (GstPulseSink * psink)
|
|
goto unlock;
|
|
}
|
|
|
|
+unlock:
|
|
v = psink->volume;
|
|
|
|
-unlock:
|
|
if (o)
|
|
pa_operation_unref (o);
|
|
|
|
@@ -1868,6 +1893,12 @@ unlock:
|
|
return v;
|
|
|
|
/* ERRORS */
|
|
+no_mainloop:
|
|
+ {
|
|
+ v = psink->volume;
|
|
+ GST_DEBUG_OBJECT (psink, "we have no mainloop");
|
|
+ return v;
|
|
+ }
|
|
no_buffer:
|
|
{
|
|
GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
|
|
@@ -1895,6 +1926,9 @@ gst_pulsesink_get_mute (GstPulseSink * psink)
|
|
uint32_t idx;
|
|
gboolean mute = FALSE;
|
|
|
|
+ if (!psink->mainloop)
|
|
+ goto no_mainloop;
|
|
+
|
|
pa_threaded_mainloop_lock (psink->mainloop);
|
|
mute = psink->mute;
|
|
|
|
@@ -1924,6 +1958,12 @@ unlock:
|
|
return mute;
|
|
|
|
/* ERRORS */
|
|
+no_mainloop:
|
|
+ {
|
|
+ mute = psink->mute;
|
|
+ GST_DEBUG_OBJECT (psink, "we have no mainloop");
|
|
+ return mute;
|
|
+ }
|
|
no_buffer:
|
|
{
|
|
GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
|
|
@@ -1976,6 +2016,9 @@ gst_pulsesink_device_description (GstPulseSink * psink)
|
|
pa_operation *o = NULL;
|
|
gchar *t;
|
|
|
|
+ if (!psink->mainloop)
|
|
+ goto no_mainloop;
|
|
+
|
|
pa_threaded_mainloop_lock (psink->mainloop);
|
|
pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
|
|
if (pbuf == NULL || pbuf->stream == NULL)
|
|
@@ -2002,6 +2045,11 @@ unlock:
|
|
return t;
|
|
|
|
/* ERRORS */
|
|
+no_mainloop:
|
|
+ {
|
|
+ GST_DEBUG_OBJECT (psink, "we have no mainloop");
|
|
+ return NULL;
|
|
+ }
|
|
no_buffer:
|
|
{
|
|
GST_DEBUG_OBJECT (psink, "we have no ringbuffer");
|
|
diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c
|
|
index b3126f4..2f1aacd 100644
|
|
--- a/ext/pulse/pulsesrc.c
|
|
+++ b/ext/pulse/pulsesrc.c
|
|
@@ -396,6 +396,9 @@ gst_pulsesrc_device_description (GstPulseSrc * pulsesrc)
|
|
pa_operation *o = NULL;
|
|
gchar *t;
|
|
|
|
+ if (!pulsesrc->mainloop)
|
|
+ goto no_mainloop;
|
|
+
|
|
pa_threaded_mainloop_lock (pulsesrc->mainloop);
|
|
|
|
if (!pulsesrc->stream)
|
|
@@ -429,6 +432,12 @@ unlock:
|
|
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
|
|
|
return t;
|
|
+
|
|
+no_mainloop:
|
|
+ {
|
|
+ GST_DEBUG_OBJECT (pulsesrc, "have no mainloop");
|
|
+ return NULL;
|
|
+ }
|
|
}
|
|
|
|
static void
|
|
--
|
|
1.7.2
|
|
|