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