From 1874a9fc8480758734748ad3ade1b3fc57d292f3 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 29 Nov 2005 16:54:50 +0000 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ gst/playback/gststreamselector.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fa91e89..92c3bbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-11-29 Jan Schmidt + * gst/playback/gststreamselector.c: (gst_stream_selector_chain): + 3rd time's the charm. Correct ref-counting for discarded buffers. + +2005-11-29 Jan Schmidt + * gst/playback/gststreamselector.c: (gst_stream_selector_class_init), (gst_stream_selector_set_property), diff --git a/gst/playback/gststreamselector.c b/gst/playback/gststreamselector.c index 8785feb..57b0660 100644 --- a/gst/playback/gststreamselector.c +++ b/gst/playback/gststreamselector.c @@ -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; } -- 2.7.4