diff options
author | Matthew Waters <matthew@centricular.com> | 2016-02-04 16:36:28 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2016-02-04 18:07:57 +1100 |
commit | 72bc7d7f736a10117fedb8e1d4013a4946cfefbc (patch) | |
tree | 2cc5f54cc56db295a1c95d5c89e16169dfb04c55 /gst | |
parent | f352691a04896d0de3381fe8ee85ada948bd6337 (diff) | |
download | gstreamer-plugins-bad-72bc7d7f736a10117fedb8e1d4013a4946cfefbc.tar.gz |
h264parse: increase caps equality check for no codec_data
When converting from avc to byte-stream, there will not be any codec_data
in the src caps. Remove it before the equality check to avoid sending caps
events downstream on every SPS/PPS change.
https://bugzilla.gnome.org/show_bug.cgi?id=761014
Diffstat (limited to 'gst')
-rw-r--r-- | gst/videoparsers/gsth264parse.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 9b90ebe17..1d50fc173 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1863,14 +1863,20 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) src_caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (h264parse)); - if (src_caps - && gst_structure_has_field (gst_caps_get_structure (src_caps, 0), - "codec_data")) { + if (src_caps) { /* use codec data from old caps for comparison; we don't want to resend caps if everything is same except codec data; */ - gst_caps_set_value (caps, "codec_data", - gst_structure_get_value (gst_caps_get_structure (src_caps, 0), - "codec_data")); + if (gst_structure_has_field (gst_caps_get_structure (src_caps, 0), + "codec_data")) { + gst_caps_set_value (caps, "codec_data", + gst_structure_get_value (gst_caps_get_structure (src_caps, 0), + "codec_data")); + } else if (!buf) { + GstStructure *s; + /* remove any left-over codec-data hanging around */ + s = gst_caps_get_structure (caps, 0); + gst_structure_remove_field (s, "codec_data"); + } } if (!(src_caps && gst_caps_is_strictly_equal (src_caps, caps))) { |