Commit 18d00033 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/video.c: setup dummy palette to avoid segfaults with some codecs.
* modules/codec/ffmpeg/ffmpeg.c: more fourccs.
parent c3089d64
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library * ffmpeg.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.74 2004/01/08 23:21:01 sigmunau Exp $ * $Id: ffmpeg.c,v 1.75 2004/01/09 00:02:55 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -565,18 +565,21 @@ static struct ...@@ -565,18 +565,21 @@ static struct
{ VLC_FOURCC('R','V','1','3'), CODEC_ID_RV10, { VLC_FOURCC('R','V','1','3'), CODEC_ID_RV10,
VIDEO_ES, "Real Video 13" }, VIDEO_ES, "Real Video 13" },
#if LIBAVCODEC_BUILD >= 4683 #if LIBAVCODEC_BUILD >= 4684
/* Apple Video */ /* Apple Video */
{ VLC_FOURCC('r','p','z','a'), CODEC_ID_RPZA, { VLC_FOURCC('r','p','z','a'), CODEC_ID_RPZA,
VIDEO_ES, "Apple Video" }, VIDEO_ES, "Apple Video" },
#endif
{ VLC_FOURCC('s','m','c',' '), CODEC_ID_SMC, { VLC_FOURCC('s','m','c',' '), CODEC_ID_SMC,
VIDEO_ES, "Apple graphics" }, VIDEO_ES, "Apple graphics" },
#if LIBAVCODEC_BUILD >= 4683
/* Cinepak */ /* Cinepak */
{ VLC_FOURCC('c','v','i','d'), CODEC_ID_CINEPAK, { VLC_FOURCC('c','v','i','d'), CODEC_ID_CINEPAK,
VIDEO_ES, "Cinepak Video" }, VIDEO_ES, "Cinepak Video" },
/* Id Quake II CIN */
{ VLC_FOURCC('I','D','C','I'), CODEC_ID_IDCIN,
VIDEO_ES, "Id Quake II CIN Video" },
#endif #endif
/* 4X Technologies */ /* 4X Technologies */
...@@ -589,6 +592,10 @@ static struct ...@@ -589,6 +592,10 @@ static struct
VIDEO_ES, "Duck TrueMotion v1 Video" }, VIDEO_ES, "Duck TrueMotion v1 Video" },
#endif #endif
/* Interplay MVE */
{ VLC_FOURCC('i','m','v','e'), CODEC_ID_INTERPLAY_VIDEO,
VIDEO_ES, "Interplay MVE Video" },
/* /*
* Audio Codecs * Audio Codecs
*/ */
...@@ -645,6 +652,10 @@ static struct ...@@ -645,6 +652,10 @@ static struct
{ VLC_FOURCC('4','x','m','a'), CODEC_ID_ADPCM_4XM, { VLC_FOURCC('4','x','m','a'), CODEC_ID_ADPCM_4XM,
AUDIO_ES, "4X Technologies Audio" }, AUDIO_ES, "4X Technologies Audio" },
/* Interplay DPCM */
{ VLC_FOURCC('i','d','p','c'), CODEC_ID_INTERPLAY_DPCM,
AUDIO_ES, "Interplay DPCM Audio" },
/* PCM */ /* PCM */
{ VLC_FOURCC('s','8',' ',' '), CODEC_ID_PCM_S8, { VLC_FOURCC('s','8',' ',' '), CODEC_ID_PCM_S8,
AUDIO_ES, "PCM S8" }, AUDIO_ES, "PCM S8" },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.c: video decoder using the ffmpeg library * video.c: video decoder using the ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.58 2004/01/08 00:12:50 gbazin Exp $ * $Id: video.c,v 1.59 2004/01/09 00:02:55 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -81,6 +81,9 @@ struct decoder_sys_t ...@@ -81,6 +81,9 @@ struct decoder_sys_t
vlc_bool_t b_pp_init; vlc_bool_t b_pp_init;
}; };
/* FIXME (dummy palette for now) */
static AVPaletteControl palette_control;
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
...@@ -332,6 +335,9 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -332,6 +335,9 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
p_dec->fmt_out.i_cat = VIDEO_ES; p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = ffmpeg_PixFmtToChroma( p_context->pix_fmt ); p_dec->fmt_out.i_codec = ffmpeg_PixFmtToChroma( p_context->pix_fmt );
/* Setup dummy palette to avoid segfaults with some codecs */
p_sys->p_context->palctrl = &palette_control;
/* ***** Open the codec ***** */ /* ***** Open the codec ***** */
vlc_mutex_lock( lockval.p_address ); vlc_mutex_lock( lockval.p_address );
if( avcodec_open( p_sys->p_context, p_sys->p_codec ) < 0 ) if( avcodec_open( p_sys->p_context, p_sys->p_codec ) < 0 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment