From b940cba826fd62ba128fa7c519fef13c9e433344 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 1 May 2013 00:15:38 +0100 Subject: [PATCH] streamsplitter: Keep srcpad alive while querying peer --- gst/encoding/gststreamsplitter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/encoding/gststreamsplitter.c b/gst/encoding/gststreamsplitter.c index ca03eadc19..ad8b161b26 100644 --- a/gst/encoding/gststreamsplitter.c +++ b/gst/encoding/gststreamsplitter.c @@ -285,6 +285,8 @@ resync: while (tmp) { GstPad *srcpad = (GstPad *) tmp->data; + /* Ensure srcpad doesn't get destroyed while we query peer */ + gst_object_ref (srcpad); STREAMS_UNLOCK (stream_splitter); if (res) { GstCaps *peercaps = gst_pad_peer_query_caps (srcpad, filter); @@ -294,6 +296,7 @@ resync: res = gst_pad_peer_query_caps (srcpad, filter); } STREAMS_LOCK (stream_splitter); + gst_object_unref (srcpad); if (G_UNLIKELY (cookie != stream_splitter->cookie)) { if (res)