014a2f7e1d4efcd86866ee67db0aa008a5b566a2
[platform/upstream/gstreamer-vaapi.git] / patches / videoparsers / 0003-h264parse-fix-and-optimize-NAL-collection-function.patch
1 From cf890efdb44feb4cfc728756bcf0ce1df17b8e9d Mon Sep 17 00:00:00 2001
2 From: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
3 Date: Tue, 24 Jun 2014 13:55:13 +0200
4 Subject: [PATCH 3/8] h264parse: fix and optimize NAL collection function.
5
6 Use gst_h264_parser_identify_nalu_unchecked() to identify the next
7 NAL unit. We don't want to parse the full NAL unit, but only the
8 header bytes and possibly the first RBSP byte for identifying the
9 first_mb_in_slice syntax element.
10
11 Also fix check for failure when returning from that function. The
12 only success condition for that is GST_H264_PARSER_OK, so use it.
13
14 https://bugzilla.gnome.org/show_bug.cgi?id=732154
15
16 Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
17 ---
18  gst/vaapi/gsth264parse.c |    6 +++---
19  1 file changed, 3 insertions(+), 3 deletions(-)
20
21 diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c
22 index fff1d48..7a88a07 100644
23 --- a/gst/vaapi/gsth264parse.c
24 +++ b/gst/vaapi/gsth264parse.c
25 @@ -668,10 +668,10 @@ gst_h264_parse_collect_nal (GstH264Parse * h264parse, const guint8 * data,
26    GstH264NalUnit nnalu;
27  
28    GST_DEBUG_OBJECT (h264parse, "parsing collected nal");
29 -  parse_res = gst_h264_parser_identify_nalu (h264parse->nalparser, data,
30 -      nalu->offset + nalu->size, size, &nnalu);
31 +  parse_res = gst_h264_parser_identify_nalu_unchecked (h264parse->nalparser,
32 +      data, nalu->offset + nalu->size, size, &nnalu);
33  
34 -  if (parse_res == GST_H264_PARSER_ERROR)
35 +  if (parse_res != GST_H264_PARSER_OK)
36      return FALSE;
37  
38    /* determine if AU complete */
39 -- 
40 1.7.9.5
41