From 4b10f278b6268b01d16052257d5da7c9ba985f03 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Tue, 27 Aug 2013 11:27:04 +0100 Subject: [PATCH] h264parse: only update src CAPS when it's necessary https://bugzilla.gnome.org/show_bug.cgi?id=705452 --- gst/videoparsers/gsth264parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index e103bbb8d2..47b9c676fb 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -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); }