[MPlayer-dev-eng] [PATCH] libmpdemux/demux_audio: Skip ID3v2.4 tags.

Ingo Brückl ib at wupperonline.de
Mon Jan 16 19:40:44 CET 2012


Benoît,

I was misunderstanding the 3DI footer and thinking of something like
ID3-frames-data-3DI<EOF> (in which case the footer wouldn't have made
much sense).

you wrote on Mon, 16 Jan 2012 13:28:38 +0100 (CET):

> @@ -358,9 +358,11 @@ static int demux_audio_open(demuxer_t* d
>  	step = 4;
>      } else if( hdr[0] == 'I' && hdr[1] == 'D' && hdr[2] == '3' && (hdr[3] >= 2)) {
>        int len;
> -      stream_skip(s,2);
> +      stream_skip(s,1);
> +      stream_read(s,hdr,1);
> +      len = hdr[0] & 0x10 ? 10 : 0;
>        stream_read(s,hdr,4);
> -      len = (hdr[0]<<21) | (hdr[1]<<14) | (hdr[2]<<7) | hdr[3];
> +      len += (hdr[0]<<21) | (hdr[1]<<14) | (hdr[2]<<7) | hdr[3];
>        stream_skip(s,len);
>        step = 4;
>      } else if( found_WAVE && hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) {

Should be ok. (Although a stream_read(s,hdr,2) and hdr[1] & 0x10 would save a
call.)

> @@ -446,6 +448,17 @@ static int demux_audio_open(demuxer_t* d
>  	g = stream_read_char(s);
>  	demux_info_add(demuxer,"Genre",genres[g]);
>        }
> +      stream_seek(s,demuxer->movi_end-10);
> +      stream_read(s,tag,4);
> +      if( tag[0] == '3' && tag[1] == 'D' && tag[2] == 'I' && ((uint8_t)tag[3] >= 2)) {

One pair of () is pointless and I personally would prefer an unsigned char
cast, but I don't know what Reimar thinks (he probably would go with hdr).
The version check should be 4.

> +	int len;
> +	stream_skip(s,1);
> +	stream_read(s,tag,1);
> +	len = tag[0] & 0x10 ? 20 : 10;
> +	stream_read(s,tag,4);
> +	len += (tag[0]<<21) | (tag[1]<<14) | (tag[2]<<7) | tag[3];
> +	demuxer->movi_end = stream_tell(s)-len;

Indentation.

Shouldn't the existence of 3DI already prove a len of 20? Hmm, A 3DI without
flag could indicate that it isn't a 3DI footer at all...

Ingo


More information about the MPlayer-dev-eng mailing list