decoder: h265: Fix offset calculation when there is more than one vps/sps/pps present in codec_data

The array_completeness, reserved bit and num_nal_units fields
in HEVCDecoderConfigurationRecord will be present for each VPS/SPS/PPS array list,
but not for each occurance of similar headers.

https://bugzilla.gnome.org/show_bug.cgi?id=764274
This commit is contained in:
Sreerenj Balachandran 2016-03-30 14:37:21 +03:00
parent 35fe2abc3e
commit c009d29c00

View file

@ -2650,13 +2650,15 @@ gst_vaapi_decoder_h265_decode_codec_data (GstVaapiDecoder *
ofs = 23;
for (i = 0; i < num_nal_arrays; i++) {
num_nals = GST_READ_UINT16_BE (buf + ofs + 1);
ofs += 3;
for (j = 0; j < num_nals; j++) {
pi = gst_vaapi_parser_info_h265_new ();
if (!pi)
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
unit.parsed_info = pi;
result = gst_h265_parser_identify_nalu_hevc (priv->parser,
buf, ofs + 3, buf_size, 2, &pi->nalu);
buf, ofs, buf_size, 2, &pi->nalu);
if (result != GST_H265_PARSER_OK) {
status = get_status (result);
goto cleanup;