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

Benoît Thébaudeau benoit.thebaudeau at advansee.com
Mon Jan 16 20:52:56 CET 2012


Reimar,

> > diff -Nrdup mplayer.orig/libmpdemux/demux_audio.c
> > mplayer/libmpdemux/demux_audio.c
> > --- mplayer.orig/libmpdemux/demux_audio.c	2011-11-11
> > 18:29:14.076503000 +0100
> > +++ mplayer/libmpdemux/demux_audio.c	2012-01-16 13:19:55.252067960
> > +0100
> > @@ -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;
> 
> Please use stream_read_char() directly instead of going through the
> tag
> variable, there's no need here.

OK.

> > +	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];
> 
> This seems to be exactly the same code.
> If so, please extract it into its own function instead of duplicating
> it.

OK. There is only a difference of 10 that can easily be dealt with.

Benoît


More information about the MPlayer-dev-eng mailing list