[MPlayer-dev-eng] [PATCH 1/3] make lavc dv encoding work in mencoder

Corey Hickey bugfood-ml at fatooh.org
Mon May 14 00:28:06 CEST 2007


Michael Niedermayer wrote:
>> -    if (!strcasecmp(lavc_param_vcodec, "mpeg1") || !strcasecmp(lavc_param_vcodec, "mpeg1video"))
>> +    if (!avcodec_inited){
>> +	avcodec_init();
>> +	avcodec_register_all();
>> +	avcodec_inited=1;
>> +    }
>> +
>> +    vf->priv->codec = (AVCodec *)avcodec_find_encoder_by_name(lavc_param_vcodec);
>> +    if (!vf->priv->codec) {
>> +	mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_MissingLAVCcodec, lavc_param_vcodec);
>> +	return 0;
>> +    }
>> +
>> +#ifdef USE_LIBAVFORMAT
>> +    mux_v->bih->biCompression = av_codec_get_tag(mp_bmp_taglists, vf->priv->codec->id);
>> +#else
> 
> iam wondering how often i need to say that av_codec_get_tag() is only
> supposed to be used with lav* opaque codec tag lists and not with
> externally provided ones

Probably you'll have to say it until you're blue in the face. ;)

Sorry, though. I'm only familiar with small portions of the mplayer and
ffmpeg code, so when I work on something new I'm apt to miss things like
this.

> here this in addition to the ABI/API issues leads to a dependancy on
> libavformat

Still, as far as I can tell I closely copied what is already written in
ae_lavc.c. Are you saying that the code ae_lavc.c in wrong as well, or
is there a difference which I don't see?

ve_lavc.c:182    (whitespace changed here to make each line fit)
#ifdef USE_LIBAVFORMAT
  lavc_param_atag = av_codec_get_tag(mp_wav_taglists, lavc_acodec->id);
#else

> may i suggest again that mplayer would use its own function to find
> a codec_tag from a codec_id for its private lists and use av_codec_get_tag
> only for the lav* lists

Ok. That will have to be later for me, though.

-Corey



More information about the MPlayer-dev-eng mailing list