[vlc-devel] [PATCH] codec: jpeg encoder: fix build for older libjpeg

Tristan Matthews le.businessman at gmail.com
Wed Feb 5 17:12:43 CET 2014


On Wed, Feb 5, 2014 at 8:28 AM, Maxim Bublis <b at codemonkey.ru> wrote:
> On Tue, Feb 4, 2014 at 10:38 PM, Tristan Matthews <le.businessman at gmail.com>
> wrote:
>>
>> ---
>>  modules/codec/jpeg.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/modules/codec/jpeg.c b/modules/codec/jpeg.c
>> index 7004fcd..3dbc035 100644
>> --- a/modules/codec/jpeg.c
>> +++ b/modules/codec/jpeg.c
>> @@ -358,7 +358,9 @@ static block_t *EncodeBlock(encoder_t *p_enc,
>> picture_t *p_pic)
>>      jpeg_set_colorspace(&p_sys->p_jpeg, JCS_YCbCr);
>>
>>      p_sys->p_jpeg.raw_data_in = TRUE;
>> +#if JPEG_LIB_VERSION >= 70
>>      p_sys->p_jpeg.do_fancy_downsampling = FALSE;
>> +#endif
>>
>>      jpeg_set_quality(&p_sys->p_jpeg, p_sys->i_quality, TRUE);
>
>
> I'm not sure this will work as expected, have you tried to capture
> screenshot with it?

Yeah, it works fine here.

> do_fancy_downsampling = FALSE tells, that input is *real* downsampled data,
> and libjpeg shouldn't do anything else with it.
> BTW, libjpeg 6 is almost 12 years old.

Indeed, I should've been more precise that this patch was to fix
compilation on systems
that ship libjpeg-turbo (Fedora in my case)



More information about the vlc-devel mailing list