x264enc: No need to copy, reffing is enough

This commit is contained in:
Sjoerd Simons 2011-05-03 15:27:43 +01:00
parent cd5fc6ed8d
commit 0d362e5572

View file

@ -1466,7 +1466,7 @@ gst_x264_enc_sink_get_caps (GstPad * pad)
/* If we already have caps return them */ /* If we already have caps return them */
if (GST_PAD_CAPS (pad)) if (GST_PAD_CAPS (pad))
return gst_caps_copy (GST_PAD_CAPS (pad)); return gst_caps_ref (GST_PAD_CAPS (pad));
encoder = GST_X264_ENC (gst_pad_get_parent (pad)); encoder = GST_X264_ENC (gst_pad_get_parent (pad));
if (!encoder) if (!encoder)
@ -1496,7 +1496,7 @@ gst_x264_enc_sink_get_caps (GstPad * pad)
caps = gst_caps_intersect (peercaps, templcaps); caps = gst_caps_intersect (peercaps, templcaps);
gst_caps_unref (peercaps); gst_caps_unref (peercaps);
} else { } else {
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); caps = gst_caps_ref (gst_pad_get_pad_template_caps (pad));
} }
gst_object_unref (encoder); gst_object_unref (encoder);