]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-bad0-10.git/commitdiff
h264parse: fix AU chunking for interlaced streams
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 12 Nov 2012 14:43:38 +0000 (14:43 +0000)
committerNikhil Devshatwar <a0132237@ti.com>
Wed, 15 May 2013 13:18:42 +0000 (18:48 +0530)
It was sending SEI chunks alone on a test stream, confusing
a decoder which expected AU alignment.

gst/videoparsers/gsth264parse.c

index 86d80dddcc484249eca8db1b038ed998a69d65c5..20edf42257999faefcc2069929013b8031a405df 100644 (file)
@@ -687,6 +687,7 @@ gst_h264_parse_check_valid_frame_worker (GstBaseParse * parse,
   gboolean drain;
   GstH264NalParser *nalparser = h264parse->nalparser;
   GstH264NalUnit nalu;
+  gboolean picture_start;
 
   /* expect at least 3 bytes startcode == sc, and 2 bytes NALU payload */
   if (G_UNLIKELY (GST_BUFFER_SIZE (buffer) < 5))
@@ -816,10 +817,12 @@ gst_h264_parse_check_valid_frame_worker (GstBaseParse * parse,
     gst_h264_parse_process_nal (h264parse, &nalu);
 
     /* simulate no next nal if none needed */
-    drain = drain || (h264parse->align == GST_H264_PARSE_ALIGN_NAL) ||
-        (h264parse->align == GST_H264_PARSE_ALIGN_AU
-        && gst_h264_parser_is_interlaced (h264parse) &&
-        nalu.type != GST_H264_NAL_SPS && nalu.type != GST_H264_NAL_PPS);
+    picture_start = (nalu.type == GST_H264_NAL_SLICE ||
+        nalu.type == GST_H264_NAL_SLICE_DPA
+        || nalu.type == GST_H264_NAL_SLICE_IDR);
+    drain = drain || (h264parse->align == GST_H264_PARSE_ALIGN_NAL)
+        || (h264parse->align == GST_H264_PARSE_ALIGN_AU
+        && gst_h264_parser_is_interlaced (h264parse) && picture_start);
 
     /* if we're waiting to switch to passthrough mode, we'll want to send
        the entire frame as is, so we try to parse the entire data we're