mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
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.
This commit is contained in:
parent
ec931601a6
commit
8b155d7188
1 changed files with 3 additions and 3 deletions
|
@ -621,7 +621,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);
|
||||
|
@ -676,7 +676,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);
|
||||
|
@ -729,7 +729,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);
|
||||
|
|
Loading…
Reference in a new issue