From: Marek Vasut Date: Fri, 11 Feb 2022 22:44:24 +0000 (+0100) Subject: jpegdec: Call gst_jpeg_turbo_parse_ext_fmt_convert() before jpeg_start_decompress() X-Git-Tag: 1.22.0~2441 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d277002186d33eed505d030bfba0ad30624306aa;p=platform%2Fupstream%2Fgstreamer.git jpegdec: Call gst_jpeg_turbo_parse_ext_fmt_convert() before jpeg_start_decompress() It is imperative that the libjpeg-turbo state is properly initialized before jpeg_start_decompress() is called. Make sure cinfo.out_color_space and cinfo.raw_data_out are set to their final values matching their peer caps before calling jpeg_start_decompress(). Fixes: e6d83d8f96 ("jpegdec: Support libjpeg-turbo colorspace conversion") Part-of: --- diff --git a/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c b/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c index 6e4199b..73157cf 100644 --- a/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c +++ b/subprojects/gst-plugins-good/ext/jpeg/gstjpegdec.c @@ -1189,6 +1189,7 @@ gst_jpeg_dec_prepare_decode (GstJpegDec * dec) dec->cinfo.do_block_smoothing = FALSE; dec->cinfo.dct_method = dec->idct_method; #ifdef JCS_EXTENSIONS + gst_jpeg_turbo_parse_ext_fmt_convert (dec, NULL); if (dec->format_convert) { dec->cinfo.out_color_space = dec->libjpeg_ext_format; dec->cinfo.raw_data_out = FALSE;