h264parse: only update src CAPS when it's necessary

https://bugzilla.gnome.org/show_bug.cgi?id=705452
This commit is contained in:
Matthieu Bouron 2013-08-27 11:27:04 +01:00 committed by Sebastian Dröge
parent 43dcebe2a0
commit 4b10f278b6

View file

@ -1150,7 +1150,7 @@ static void
gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
{
GstH264SPS *sps;
GstCaps *sink_caps;
GstCaps *sink_caps, *src_caps;
gboolean modified = FALSE;
GstBuffer *buf = NULL;
GstStructure *s = NULL;
@ -1323,7 +1323,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
gst_structure_remove_field (s, "codec_data");
gst_buffer_replace (&h264parse->codec_data, NULL);
}
gst_pad_set_caps (GST_BASE_PARSE_SRC_PAD (h264parse), caps);
src_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (h264parse));
if (!(src_caps && gst_caps_is_strictly_equal (src_caps, caps)))
gst_pad_set_caps (GST_BASE_PARSE_SRC_PAD (h264parse), caps);
if (src_caps)
gst_caps_unref (src_caps);
gst_caps_unref (caps);
}