[MPlayer-dev-eng] [PATCH] AVCodecTag redefined when using external libavformat

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Feb 4 14:18:15 CET 2007


Hello,
On Sun, Feb 04, 2007 at 01:19:16PM +0100, Nico Sabbi wrote:
> Michael Niedermayer wrote:
> >>calling av_codec_get_tag() and av_codec_get_id() requires as 
> >>parameters the tables we actually need, so how can they be useful in 
> >>this case?
> >
> >
> >avi_muxer.codec_tag can be passed to them
> >
> >and the additional tables mplayer uses cannot use AVCodecTag they can
> >use MPCodecTag (which may or may not be the same / is copy and pasted
> >but wont break if AVCodecTag changes)

Huh? What does changing the name help? It will still break because we
call a function that wants an AVCodecTag struct.
Unless I miss something changing the name is IMO just pure obfuscation.

> -const struct AVCodecTag *mp_bmp_taglists[] = {codec_bmp_tags, mp_bmp_tags, 0};
> +const struct AVCodecTag *mp_bmp_taglists[3];
>  
>  static int mp_open(URLContext *h, const char *filename, int flags){
>      return 0;
> @@ -193,6 +199,14 @@
>  
>      memset(&ap, 0, sizeof(AVFormatParameters));
>  
> +    mp_wav_taglists[0] = avi_muxer.codec_tag[1];
> +    mp_wav_taglists[1] = mp_wav_tags;
> +    mp_wav_taglists[2] = 0;
> +
> +    mp_bmp_taglists[0] = avi_muxer.codec_tag[0];
> +    mp_bmp_taglists[1] = mp_bmp_tags;
> +    mp_bmp_taglists[2] = 0;
> +

Can't you just use avi_muxer.codec_tag[0] directly in the initialization
above instead of initializing it at runtime?

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list