summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@collabora.com>2013-08-27 11:27:04 +0100
committerTim-Philipp Müller <tim@centricular.net>2013-08-28 23:29:29 +0100
commit8eda10a957a57d1edcd0c4c596c1901c6d405653 (patch)
treee3454bda38547181bc218909ab6feb7edc447bdc
parentc7be8859924473acec65786e1e242de1204e8067 (diff)
downloadgstreamer-plugins-bad-8eda10a957a57d1edcd0c4c596c1901c6d405653.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 a778a942e..4114a5a1e 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1099,7 +1099,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;
@@ -1238,7 +1238,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
s = gst_caps_get_structure (caps, 0);
gst_structure_remove_field (s, "codec_data");
}
- 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);
}