[MPlayer-dev-eng] [PATCH] lavf demuxer: always overwrite codec_tag for PCM formats

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Jan 13 19:03:21 CET 2008


Hello,
On Sun, Jan 13, 2008 at 06:40:21PM +0100, Roberto Togni wrote:
> Index: demux_lavf.c
> ===================================================================
> --- demux_lavf.c	(revision 25730)
> +++ demux_lavf.c	(working copy)
> @@ -92,9 +92,6 @@
>      { CODEC_ID_MUSEPACK7,         MKTAG('M', 'P', 'C', ' ')},
>      { CODEC_ID_MUSEPACK8,         MKTAG('M', 'P', 'C', '8')},
>      { CODEC_ID_NELLYMOSER,        MKTAG('N', 'E', 'L', 'L')},    
> -    { CODEC_ID_PCM_S24BE,         MKTAG('i', 'n', '2', '4')},
> -    { CODEC_ID_PCM_S16BE,         MKTAG('t', 'w', 'o', 's')},
> -    { CODEC_ID_PCM_S8,            MKTAG('t', 'w', 'o', 's')},
>      { CODEC_ID_ROQ_DPCM,          MKTAG('R', 'o', 'Q', 'A')},
>      { CODEC_ID_SHORTEN,           MKTAG('s', 'h', 'r', 'n')},
>      { CODEC_ID_TTA,               MKTAG('T', 'T', 'A', '1')},
> @@ -128,6 +125,17 @@
>  
>  const struct AVCodecTag *mp_bmp_taglists[] = {codec_bmp_tags, mp_bmp_tags, 0};
>  
> +static const AVCodecTag mp_pcm_tags[] = {
> +    { CODEC_ID_PCM_S8,            MKTAG('t', 'w', 'o', 's')},
> +    { CODEC_ID_PCM_U8,            0},
> +    { CODEC_ID_PCM_S16BE,         MKTAG('t', 'w', 'o', 's')},
> +    { CODEC_ID_PCM_S16LE,         0},
> +    { CODEC_ID_PCM_S24BE,         MKTAG('i', 'n', '2', '4')},
> +    { 0, 0 },
> +};
> +
> +const struct AVCodecTag *mp_pcm_taglists[] = {mp_pcm_tags, 0};
> +

IMHO it should be before the mp_bmp_tags, not after.
In addition I'd propose a name more like mp_wav_override_tags or some
such. Or just always override codec_tag, though that means a bit of a
loss of information (do some lavc codecs still have checks against
codec_tag or were they all removed?).

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list