mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
decodebin2: avoid some _caps_ref in some cases
Only mess with the caps refcount when we configure different caps.
This commit is contained in:
parent
8f2f705c21
commit
e685a9e86d
1 changed files with 12 additions and 6 deletions
|
@ -749,14 +749,21 @@ gst_decode_bin_finalize (GObject * object)
|
|||
static void
|
||||
gst_decode_bin_set_caps (GstDecodeBin * dbin, GstCaps * caps)
|
||||
{
|
||||
GstCaps *old;
|
||||
|
||||
GST_DEBUG_OBJECT (dbin, "Setting new caps: %" GST_PTR_FORMAT, caps);
|
||||
|
||||
GST_OBJECT_LOCK (dbin);
|
||||
if (dbin->caps)
|
||||
gst_caps_unref (dbin->caps);
|
||||
if (caps)
|
||||
gst_caps_ref (caps);
|
||||
dbin->caps = caps;
|
||||
old = dbin->caps;
|
||||
if (old != caps) {
|
||||
if (caps)
|
||||
gst_caps_ref (caps);
|
||||
|
||||
dbin->caps = caps;
|
||||
|
||||
if (old)
|
||||
gst_caps_unref (old);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (dbin);
|
||||
}
|
||||
|
||||
|
@ -766,7 +773,6 @@ gst_decode_bin_set_caps (GstDecodeBin * dbin, GstCaps * caps)
|
|||
*
|
||||
* MT-safe
|
||||
*/
|
||||
|
||||
static GstCaps *
|
||||
gst_decode_bin_get_caps (GstDecodeBin * dbin)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue