summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2017-03-08 17:09:28 +0900
committerSebastian Dröge <sebastian@centricular.com>2017-03-08 14:18:18 +0200
commita997a99fdd3b0f06c960d46c8155631fdaa58a77 (patch)
tree421758d5a3bc74f8e0583c5b15086f2e35b0f969 /gst
parent0968bad8a4bf0681e61c48afbd7962a3a8c9a3cd (diff)
downloadgstreamer-plugins-bad-a997a99fdd3b0f06c960d46c8155631fdaa58a77.tar.gz
h264parse: fix some failures in testcases
Move logic of judgement whether or not to insert AU Delimiter before draining. Besides, aud_needed flag is reset to TRUE when skip. https://bugzilla.gnome.org/show_bug.cgi?id=736213
Diffstat (limited to 'gst')
-rw-r--r--gst/videoparsers/gsth264parse.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 6aeb4e16f..58afd771b 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1199,6 +1199,7 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
if (current_off == 0) {
GST_DEBUG_OBJECT (h264parse, "skipping broken nal");
*skipsize = nalu.offset;
+ h264parse->aud_needed = TRUE;
goto skip;
} else {
GST_DEBUG_OBJECT (h264parse, "terminating au");
@@ -1232,20 +1233,25 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
"broken/invalid nal Type: %d %s, Size: %u will be dropped",
nalu.type, _nal_name (nalu.type), nalu.size);
*skipsize = nalu.size;
+ h264parse->aud_needed = TRUE;
goto skip;
}
+ /* Judge whether or not to insert AU Delimiter in case of byte-stream
+ * If we're in the middle of au, we don't need to insert aud.
+ * Otherwise, we honor the result in gst_h264_parse_process_nal.
+ * Note that this should be done until draining if it's happening.
+ */
+ if (h264parse->align == GST_H264_PARSE_ALIGN_NAL && !h264parse->aud_needed)
+ h264parse->aud_insert = FALSE;
+
if (nonext)
break;
/* if no next nal, we know it's complete here */
au_complete = gst_h264_parse_collect_nal (h264parse, data, size, &nalu);
- /* Judge whether or not to insert AU Delimiter in case of byte-stream */
if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) {
- if (!h264parse->aud_needed)
- h264parse->aud_insert = FALSE;
-
h264parse->aud_needed = au_complete;
break;
}