From 63fee31a3f95021fa0bb2429c723f5356c9b3c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 6 Jan 2014 14:52:54 +0100 Subject: [PATCH] h265parse: Allows hvc1 version 0 and fix reading of NAL count in codec_data --- gst/videoparsers/gsth265parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index 8afdfe3b8e..95ca9284c8 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -1771,8 +1771,9 @@ gst_h265_parse_set_caps (GstBaseParse * parse, GstCaps * caps) gst_buffer_unmap (codec_data, &map); goto hvcc_too_small; } - /* parse the version, this must be one */ - if (data[0] != 1) { + /* parse the version, this must be one but + * is zero until the spec is finalized */ + if (data[0] != 0 && data[0] != 1) { gst_buffer_unmap (codec_data, &map); goto wrong_version; } @@ -1783,7 +1784,7 @@ gst_h265_parse_set_caps (GstBaseParse * parse, GstCaps * caps) off = 23; for (i = 0; i < data[22]; i++) { - num_nals = (data[off + 1] >> 7) | data[off + 2]; + num_nals = GST_READ_UINT16_BE (data + off + 1); for (j = 0; j < num_nals; j++) { parseres = gst_h265_parser_identify_nalu_hevc (h265parse->nalparser, data, off + 3, size, 2, &nalu);