jpeg: handle comment segments.

Fix decode_buffer() function to gracefully skip comment (COM) segments.
This fixes decoding of streams generated by certain cameras, e.g. like
the Logitech Pro C920.

https://bugzilla.gnome.org/show_bug.cgi?id=708208

Signed-off-by: Junfeng Xu <jun.feng.xu@intel.com>
This commit is contained in:
Junfeng Xu 2013-09-17 14:29:54 +08:00 committed by Gwenole Beauchesne
parent 77298beb15
commit a4aac6b89e

View file

@ -581,6 +581,9 @@ decode_buffer(GstVaapiDecoderJpeg *decoder, const guchar *buf, guint buf_size)
case GST_JPEG_MARKER_DRI:
status = decode_restart_interval(decoder, buf + seg.offset, seg.size);
break;
case GST_JPEG_MARKER_COM:
status = GST_VAAPI_DECODER_STATUS_SUCCESS;
break;
case GST_JPEG_MARKER_DAC:
GST_ERROR("unsupported arithmetic coding mode");
status = GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE;