mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +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
|
static void
|
||||||
gst_decode_bin_set_caps (GstDecodeBin * dbin, GstCaps * caps)
|
gst_decode_bin_set_caps (GstDecodeBin * dbin, GstCaps * caps)
|
||||||
{
|
{
|
||||||
|
GstCaps *old;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dbin, "Setting new caps: %" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (dbin, "Setting new caps: %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (dbin);
|
GST_OBJECT_LOCK (dbin);
|
||||||
if (dbin->caps)
|
old = dbin->caps;
|
||||||
gst_caps_unref (dbin->caps);
|
if (old != caps) {
|
||||||
if (caps)
|
if (caps)
|
||||||
gst_caps_ref (caps);
|
gst_caps_ref (caps);
|
||||||
|
|
||||||
dbin->caps = caps;
|
dbin->caps = caps;
|
||||||
|
|
||||||
|
if (old)
|
||||||
|
gst_caps_unref (old);
|
||||||
|
}
|
||||||
GST_OBJECT_UNLOCK (dbin);
|
GST_OBJECT_UNLOCK (dbin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -766,7 +773,6 @@ gst_decode_bin_set_caps (GstDecodeBin * dbin, GstCaps * caps)
|
||||||
*
|
*
|
||||||
* MT-safe
|
* MT-safe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_decode_bin_get_caps (GstDecodeBin * dbin)
|
gst_decode_bin_get_caps (GstDecodeBin * dbin)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue