[gst-cvs] gst-plugins-good: pulsesink: Convert an erroneous assertion

Jan Schmidt thaytan at kemper.freedesktop.org
Thu May 21 13:37:03 PDT 2009


Module: gst-plugins-good
Branch: master
Commit: cf584105c6d3cdf5effc6a8a7acc749e72d026ff
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=cf584105c6d3cdf5effc6a8a7acc749e72d026ff

Author: Jan Schmidt <thaytan at noraisin.net>
Date:   Fri May 15 10:42:19 2009 +0100

pulsesink: Convert an erroneous assertion

Occasionally, we get a change callback for an old stream, triggering
the assertion unnecessarily. Just ignore such callbacks.

---

 ext/pulse/pulsesink.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index 0275d34..9743662 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -1516,9 +1516,11 @@ gst_pulsesink_sink_input_info_cb (pa_context * c, const pa_sink_input_info * i,
   if (!pbuf->stream)
     goto done;
 
-  g_assert (i->index == pa_stream_get_index (pbuf->stream));
-
-  psink->volume = pa_sw_volume_to_linear (pa_cvolume_max (&i->volume));
+  /* If the index doesn't match our current stream,
+   * it implies we just recreated the stream (caps change)
+   */
+  if (i->index == pa_stream_get_index (pbuf->stream))
+    psink->volume = pa_sw_volume_to_linear (pa_cvolume_max (&i->volume));
 
 done:
   pa_threaded_mainloop_signal (psink->mainloop, 0);





More information about the Gstreamer-commits mailing list