From e12044c35936551b5e0aee2daf5c3f2650228413 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 18 Nov 2011 15:10:57 +0100 Subject: [PATCH] h264parse: avoid additional NAL parsing if no AU collection is needed --- gst/videoparsers/gsth264parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 82d03492e3..16850870ed 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -539,6 +539,10 @@ gst_h264_parse_collect_nal (GstH264Parse * h264parse, const guint8 * data, GstH264NalUnitType nal_type = nalu->type; GstH264NalUnit nnalu; + if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) { + return TRUE; + } + GST_DEBUG_OBJECT (h264parse, "parsing collected nal"); parse_res = gst_h264_parser_identify_nalu (h264parse->nalparser, data, nalu->offset + nalu->size, size, &nnalu); @@ -546,10 +550,6 @@ gst_h264_parse_collect_nal (GstH264Parse * h264parse, const guint8 * data, if (parse_res == GST_H264_PARSER_ERROR) return FALSE; - if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) { - return TRUE; - } - /* determine if AU complete */ GST_LOG_OBJECT (h264parse, "nal type: %d", nal_type); /* coded slice NAL starts a picture,