From e6ab0787856558588c9141afd25ab4fab30e8bc0 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 12 Jan 2010 09:58:48 -0300 Subject: [PATCH] h264parse: remove codec_data if output is bytestream codec_data should be removed from the src pad caps if the output is in bytestream format Fixes #606657 --- gst/h264parse/gsth264parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c index 962357b..23f9f74 100644 --- a/gst/h264parse/gsth264parse.c +++ b/gst/h264parse/gsth264parse.c @@ -1169,6 +1169,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) { GstH264Sps *sps = NULL; GstCaps *src_caps = NULL; + GstStructure *structure; gboolean modified = FALSE; /* current PPS dictates which SPS to use */ @@ -1225,14 +1226,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) } } + structure = gst_caps_get_structure (src_caps, 0); /* transforming to non-bytestream needs to make codec-data */ if (h264parse->format == GST_H264_PARSE_FORMAT_SAMPLE) { GstBuffer *buf; - GstStructure *structure; const GValue *value = NULL; const GstBuffer *codec_data = NULL; - structure = gst_caps_get_structure (src_caps, 0); value = gst_structure_get_value (structure, "codec_data"); if (value != NULL) codec_data = gst_value_get_buffer (value); @@ -1250,6 +1250,12 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) } else { GST_DEBUG_OBJECT (h264parse, "no codec_data yet"); } + } else if (h264parse->format == GST_H264_PARSE_FORMAT_BYTE) { + /* need to remove the codec_data */ + if (gst_structure_has_field (structure, "codec_data")) { + gst_structure_remove_field (structure, "codec_data"); + modified = TRUE; + } } /* save as new caps, caps will be set when pushing data */ -- 2.7.4