diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2012-08-24 11:36:16 +0300 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-07 14:11:37 +0200 |
commit | 5b0ea3fcd496e605cd4cec93c380c90a5eafd490 (patch) | |
tree | 6fd9e297fbf84d64857df8bb33ea34ed28f1301f | |
parent | 9f3c01097567a0f235eedc381b3904842c800767 (diff) | |
download | gst-vaapi-5b0ea3fcd496e605cd4cec93c380c90a5eafd490.tar.gz |
jpeg: fix end-of-image (EOI) handler.
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>
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c index 5cfbe4d6..32003972 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c @@ -540,7 +540,12 @@ decode_buffer(GstVaapiDecoderJpeg *decoder, GstBuffer *buffer) 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); @@ -601,6 +606,7 @@ decode_buffer(GstVaapiDecoderJpeg *decoder, GstBuffer *buffer) if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) break; } +end: return status; } |