X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=modules%2Fcodec%2Fffmpeg%2Fvideo.c;h=dfb5a3707218ba365980574168df3b743b827e19;hb=fa5f109874fe4b8bd8e405e674c8d73603f64eb1;hp=34b2009855175cbe072561c0eae6d78d90cab8d8;hpb=64b64281816d39e32c8db1c0f8caaa3f99c99eda;p=vlc diff --git a/modules/codec/ffmpeg/video.c b/modules/codec/ffmpeg/video.c index 34b2009855..dfb5a37072 100644 --- a/modules/codec/ffmpeg/video.c +++ b/modules/codec/ffmpeg/video.c @@ -2,7 +2,7 @@ * video.c: video decoder using the ffmpeg library ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: video.c,v 1.61 2004/01/18 21:30:25 fenrir Exp $ + * $Id: video.c,v 1.62 2004/01/25 21:39:37 gbazin Exp $ * * Authors: Laurent Aimar * Gildas Bazin @@ -335,9 +335,13 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, p_dec->fmt_out.i_cat = VIDEO_ES; p_dec->fmt_out.i_codec = ffmpeg_PixFmtToChroma( p_context->pix_fmt ); - /* Setup dummy palette to avoid segfaults with some codecs */ + /* Setup palette */ #if LIBAVCODEC_BUILD >= 4688 - p_sys->p_context->palctrl = &palette_control; + if( p_dec->fmt_in.video.p_palette ) + p_sys->p_context->palctrl = + (AVPaletteControl *)p_dec->fmt_in.video.p_palette; + else + p_sys->p_context->palctrl = &palette_control; #endif /* ***** Open the codec ***** */