imagefreeze: Don't call gst_caps_unref() on template caps when already unreferenced

Adding an extra condition while calling gst_caps_unref (templ)
and replacing gst_caps_make_writable (gst_caps_ref (caps)) with
gst_caps_copy (caps) in line 177, since the functionality is same.

https://bugzilla.gnome.org/show_bug.cgi?id=735795
This commit is contained in:
Vineeth T M 2014-09-01 16:39:23 +05:30 committed by Sebastian Dröge
parent 116649371e
commit 3a1e010221

View file

@ -174,7 +174,7 @@ gst_image_freeze_sink_setcaps (GstImageFreeze * self, GstCaps * caps)
GstPad *pad; GstPad *pad;
pad = self->sinkpad; pad = self->sinkpad;
caps = gst_caps_make_writable (gst_caps_ref (caps)); caps = gst_caps_copy (caps);
GST_DEBUG_OBJECT (pad, "Setting caps: %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (pad, "Setting caps: %" GST_PTR_FORMAT, caps);
@ -285,7 +285,8 @@ gst_image_freeze_sink_getcaps (GstImageFreeze * self, GstCaps * filter)
GST_LOG_OBJECT (self, "going to copy"); GST_LOG_OBJECT (self, "going to copy");
ret = gst_caps_copy (templ); ret = gst_caps_copy (templ);
} }
gst_caps_unref (templ); if (templ)
gst_caps_unref (templ);
if (filter) if (filter)
gst_caps_unref (filter); gst_caps_unref (filter);