summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@collabora.com>2013-08-27 11:27:04 +0100
committerSebastian Dröge <slomo@circular-chaos.org>2013-08-27 15:00:45 +0200
commit4b10f278b6268b01d16052257d5da7c9ba985f03 (patch)
tree0e6a35b2278550431f768bdd850e722974f08a96
parent43dcebe2a024547d04cd4d7fac41cc88c6d13dd6 (diff)
downloadgstreamer-plugins-bad-4b10f278b6268b01d16052257d5da7c9ba985f03.tar.gz
h264parse: only update src CAPS when it's necessary
https://bugzilla.gnome.org/show_bug.cgi?id=705452
-rw-r--r--gst/videoparsers/gsth264parse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index e103bbb8d..47b9c676f 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);
}