decode_current_picture() was converted to return a gboolean instead
of a GstVaapiDecoderStatus, so we were not getting out of the decode
loop as expected, or could cause an error instead.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
status = GST_VAAPI_DECODER_STATUS_SUCCESS;
break;
case GST_JPEG_MARKER_EOI:
- status = decode_current_picture(decoder);
+ if (decode_current_picture(decoder)) {
+ /* Get out of the loop, trailing data is not needed */
+ status = GST_VAAPI_DECODER_STATUS_SUCCESS;
+ goto end;
+ }
+ status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
break;
case GST_JPEG_MARKER_DHT:
status = decode_huffman_table(decoder, buf + seg.offset, seg.size);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
break;
}
+end:
return status;
}