gst/playback/gststreamselector.c: 3rd time's the charm. Correct ref-counting for discarded buffers.

Original commit message from CVS:
* gst/playback/gststreamselector.c: (gst_stream_selector_chain):
3rd time's the charm. Correct ref-counting for discarded buffers.
This commit is contained in:
Jan Schmidt 2005-11-29 16:54:50 +00:00
parent 35905dcfb6
commit 1874a9fc84
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-11-29 Jan Schmidt <thaytan@mad.scientist.com>
* gst/playback/gststreamselector.c: (gst_stream_selector_chain):
3rd time's the charm. Correct ref-counting for discarded buffers.
2005-11-29 Jan Schmidt <thaytan@mad.scientist.com>
* gst/playback/gststreamselector.c:

View file

@ -326,12 +326,19 @@ gst_stream_selector_chain (GstPad * pad, GstBuffer * buf)
{
GstStreamSelector *sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad));
GstFlowReturn res;
GstPad *active_sinkpad;
GST_OBJECT_LOCK (sel);
active_sinkpad = sel->active_sinkpad;
GST_OBJECT_UNLOCK (sel);
/* Ignore buffers from pads except the selected one */
if (pad != sel->active_sinkpad) {
if (pad != active_sinkpad) {
GST_DEBUG_OBJECT (sel, "Ignoring buffer %p from pad %s:%s",
buf, GST_DEBUG_PAD_NAME (pad));
gst_object_unref (sel);
gst_buffer_unref (buf);
return GST_FLOW_NOT_LINKED;
}