summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-05 23:10:46 +0400
committerTim-Philipp Müller <tim@centricular.com>2019-05-06 23:43:07 +0200
commitc44ab97026b33a5ec811592fe720677bacd2e3d5 (patch)
tree9b524e1d8dddcf7737aea6b9694390f39793de79
parentd285cd5a6b5beca44baf7c3270122fb8910714f5 (diff)
downloadgstreamer-plugins-good-c44ab97026b33a5ec811592fe720677bacd2e3d5.tar.gz
pulsesrc: fix checking for invalid stream index
PA_INVALID_INDEX, the default value, is unfortunately !0. Setting the volume before the stream is created will put the ring buffer in error state. Unfortunately, that's what spice-gtk does.
-rw-r--r--ext/pulse/pulsesrc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c
index 7af74ee6e..19ca2c97d 100644
--- a/ext/pulse/pulsesrc.c
+++ b/ext/pulse/pulsesrc.c
@@ -622,7 +622,7 @@ gst_pulsesrc_set_stream_volume (GstPulseSrc * pulsesrc, gdouble volume)
if (!pulsesrc->mainloop)
goto no_mainloop;
- if (!pulsesrc->source_output_idx)
+ if (pulsesrc->source_output_idx == PA_INVALID_INDEX)
goto no_index;
pa_threaded_mainloop_lock (pulsesrc->mainloop);
@@ -677,7 +677,7 @@ gst_pulsesrc_set_stream_mute (GstPulseSrc * pulsesrc, gboolean mute)
if (!pulsesrc->mainloop)
goto no_mainloop;
- if (!pulsesrc->source_output_idx)
+ if (pulsesrc->source_output_idx == PA_INVALID_INDEX)
goto no_index;
pa_threaded_mainloop_lock (pulsesrc->mainloop);
@@ -730,7 +730,7 @@ gst_pulsesrc_set_stream_device (GstPulseSrc * pulsesrc, const gchar * device)
if (!pulsesrc->mainloop)
goto no_mainloop;
- if (!pulsesrc->source_output_idx)
+ if (pulsesrc->source_output_idx == PA_INVALID_INDEX)
goto no_index;
pa_threaded_mainloop_lock (pulsesrc->mainloop);