Commit 757a94aa authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: remove redundant codec name parameter

parent e13caffb
...@@ -127,7 +127,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) ...@@ -127,7 +127,7 @@ static int OpenAudioCodec( decoder_t *p_dec )
!p_dec->fmt_in.b_packetized ) ) !p_dec->fmt_in.b_packetized ) )
{ {
msg_Warn( p_dec, "waiting for extra data for codec %s", msg_Warn( p_dec, "waiting for extra data for codec %s",
p_sys->psz_namecodec ); p_sys->p_codec->name );
return 1; return 1;
} }
} }
...@@ -236,7 +236,7 @@ static int GetAudioBuf( AVCodecContext *ctx, AVFrame *buf ) ...@@ -236,7 +236,7 @@ static int GetAudioBuf( AVCodecContext *ctx, AVFrame *buf )
* The avcodec codec will be opened, some memory allocated. * The avcodec codec will be opened, some memory allocated.
*****************************************************************************/ *****************************************************************************/
int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context, int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
const AVCodec *p_codec, int i_codec_id, const char *psz_namecodec ) const AVCodec *p_codec, int i_codec_id )
{ {
decoder_sys_t *p_sys; decoder_sys_t *p_sys;
...@@ -256,7 +256,6 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -256,7 +256,6 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->p_context = p_context; p_sys->p_context = p_context;
p_sys->p_codec = p_codec; p_sys->p_codec = p_codec;
p_sys->i_codec_id = i_codec_id; p_sys->i_codec_id = i_codec_id;
p_sys->psz_namecodec = psz_namecodec;
p_sys->b_delayed_open = true; p_sys->b_delayed_open = true;
// Initialize decoder extradata // Initialize decoder extradata
......
...@@ -298,16 +298,13 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -298,16 +298,13 @@ static int OpenDecoder( vlc_object_t *p_this )
switch( i_cat ) switch( i_cat )
{ {
case VIDEO_ES: case VIDEO_ES:
i_result = InitVideoDec( p_dec, p_context, p_codec, i_result = InitVideoDec( p_dec, p_context, p_codec, i_codec_id );
i_codec_id, psz_namecodec );
break; break;
case AUDIO_ES: case AUDIO_ES:
i_result = InitAudioDec( p_dec, p_context, p_codec, i_result = InitAudioDec( p_dec, p_context, p_codec, i_codec_id );
i_codec_id, psz_namecodec );
break; break;
case SPU_ES: case SPU_ES:
i_result = InitSubtitleDec( p_dec, p_context, p_codec, i_result = InitSubtitleDec( p_dec, p_context, p_codec, i_codec_id );
i_codec_id, psz_namecodec );
break; break;
default: default:
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -350,7 +347,7 @@ static void CloseDecoder( vlc_object_t *p_this ) ...@@ -350,7 +347,7 @@ static void CloseDecoder( vlc_object_t *p_this )
avcodec_close( p_sys->p_context ); avcodec_close( p_sys->p_context );
vlc_avcodec_unlock(); vlc_avcodec_unlock();
} }
msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->psz_namecodec ); msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->p_codec->name );
av_free( p_sys->p_context ); av_free( p_sys->p_context );
} }
...@@ -383,11 +380,11 @@ int ffmpeg_OpenCodec( decoder_t *p_dec ) ...@@ -383,11 +380,11 @@ int ffmpeg_OpenCodec( decoder_t *p_dec )
if( ret < 0 ) if( ret < 0 )
{ {
msg_Err( p_dec, "cannot start codec (%s)", p_sys->psz_namecodec ); msg_Err( p_dec, "cannot start codec (%s)", p_sys->p_codec->name );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
msg_Dbg( p_dec, "codec (%s) started", p_sys->psz_namecodec ); msg_Dbg( p_dec, "codec (%s) started", p_sys->p_codec->name );
p_sys->b_delayed_open = false; p_sys->b_delayed_open = false;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -45,16 +45,16 @@ void CloseDeinterlace( vlc_object_t * ); ...@@ -45,16 +45,16 @@ void CloseDeinterlace( vlc_object_t * );
/* Video Decoder */ /* Video Decoder */
int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
const AVCodec *p_codec, int i_codec_id, const char *psz_namecodec ); const AVCodec *p_codec, int i_codec_id );
void EndVideoDec( decoder_t *p_dec ); void EndVideoDec( decoder_t *p_dec );
/* Audio Decoder */ /* Audio Decoder */
int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context, int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
const AVCodec *p_codec, int i_codec_id, const char *psz_namecodec ); const AVCodec *p_codec, int i_codec_id );
/* Subtitle Decoder */ /* Subtitle Decoder */
int InitSubtitleDec( decoder_t *p_dec, AVCodecContext *p_context, int InitSubtitleDec( decoder_t *p_dec, AVCodecContext *p_context,
const AVCodec *p_codec, int i_codec_id, const char *psz_namecodec ); const AVCodec *p_codec, int i_codec_id );
/* Initialize decoder */ /* Initialize decoder */
int ffmpeg_OpenCodec( decoder_t *p_dec ); int ffmpeg_OpenCodec( decoder_t *p_dec );
...@@ -244,7 +244,6 @@ int ffmpeg_OpenCodec( decoder_t *p_dec ); ...@@ -244,7 +244,6 @@ int ffmpeg_OpenCodec( decoder_t *p_dec );
#define AVCODEC_COMMON_MEMBERS \ #define AVCODEC_COMMON_MEMBERS \
int i_codec_id; \ int i_codec_id; \
const char *psz_namecodec; \
AVCodecContext *p_context; \ AVCodecContext *p_context; \
const AVCodec *p_codec; \ const AVCodec *p_codec; \
bool b_delayed_open; bool b_delayed_open;
......
...@@ -50,7 +50,7 @@ static subpicture_t *DecodeSubtitle(decoder_t *, block_t **); ...@@ -50,7 +50,7 @@ static subpicture_t *DecodeSubtitle(decoder_t *, block_t **);
* Initialize subtitle decoder * Initialize subtitle decoder
*/ */
int InitSubtitleDec(decoder_t *dec, AVCodecContext *context, int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
const AVCodec *codec, int codec_id, const char *namecodec) const AVCodec *codec, int codec_id)
{ {
decoder_sys_t *sys; decoder_sys_t *sys;
...@@ -75,7 +75,6 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context, ...@@ -75,7 +75,6 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
sys->p_context = context; sys->p_context = context;
sys->p_codec = codec; sys->p_codec = codec;
sys->i_codec_id = codec_id; sys->i_codec_id = codec_id;
sys->psz_namecodec = namecodec;
sys->b_delayed_open = false; sys->b_delayed_open = false;
/* */ /* */
...@@ -101,14 +100,14 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context, ...@@ -101,14 +100,14 @@ int InitSubtitleDec(decoder_t *dec, AVCodecContext *context,
av_dict_free(&options); av_dict_free(&options);
if (ret < 0) { if (ret < 0) {
msg_Err(dec, "cannot open codec (%s)", namecodec); msg_Err(dec, "cannot open codec (%s)", codec->name);
free(context->extradata); free(context->extradata);
free(sys); free(sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* */ /* */
msg_Dbg(dec, "libavcodec codec (%s) started", namecodec); msg_Dbg(dec, "libavcodec codec (%s) started", codec->name);
dec->fmt_out.i_cat = SPU_ES; dec->fmt_out.i_cat = SPU_ES;
dec->pf_decode_sub = DecodeSubtitle; dec->pf_decode_sub = DecodeSubtitle;
......
...@@ -206,7 +206,7 @@ static int OpenVideoCodec( decoder_t *p_dec ) ...@@ -206,7 +206,7 @@ static int OpenVideoCodec( decoder_t *p_dec )
p_sys->i_codec_id == AV_CODEC_ID_THEORA ) p_sys->i_codec_id == AV_CODEC_ID_THEORA )
{ {
msg_Warn( p_dec, "waiting for extra data for codec %s", msg_Warn( p_dec, "waiting for extra data for codec %s",
p_sys->psz_namecodec ); p_sys->p_codec->name );
return 1; return 1;
} }
} }
...@@ -258,7 +258,7 @@ static int OpenVideoCodec( decoder_t *p_dec ) ...@@ -258,7 +258,7 @@ static int OpenVideoCodec( decoder_t *p_dec )
* opened (done after the first decoded frame). * opened (done after the first decoded frame).
*****************************************************************************/ *****************************************************************************/
int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
const AVCodec *p_codec, int i_codec_id, const char *psz_namecodec ) const AVCodec *p_codec, int i_codec_id )
{ {
decoder_sys_t *p_sys; decoder_sys_t *p_sys;
int i_val; int i_val;
...@@ -272,7 +272,6 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -272,7 +272,6 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->p_context = p_context; p_sys->p_context = p_context;
p_sys->p_codec = p_codec; p_sys->p_codec = p_codec;
p_sys->i_codec_id = i_codec_id; p_sys->i_codec_id = i_codec_id;
p_sys->psz_namecodec = psz_namecodec;
p_sys->p_ff_pic = avcodec_alloc_frame(); p_sys->p_ff_pic = avcodec_alloc_frame();
p_sys->b_delayed_open = true; p_sys->b_delayed_open = true;
p_sys->p_va = NULL; p_sys->p_va = NULL;
......
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