[FFmpeg-devel] [PATCH] id3v2 unsynchronisation support

Michael Niedermayer michaelni
Sun Jul 25 15:17:37 CEST 2010


On Sun, Jul 25, 2010 at 01:32:03PM +0200, Reimar D?ffinger wrote:
> On Sun, Jul 25, 2010 at 01:14:24PM +0200, Michael Niedermayer wrote:
> > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> > > index 941691a..87d632a 100644
> > > --- a/libavformat/aviobuf.c
> > > +++ b/libavformat/aviobuf.c
> > > @@ -387,6 +387,19 @@ void init_checksum(ByteIOContext *s,
> > >      }
> > >  }
> > >  
> > > +int peek_byte(ByteIOContext *s)
> > > +{
> > > +    if (s->buf_ptr < s->buf_end) {
> > > +        return *s->buf_ptr;
> > > +    } else {
> > > +        fill_buffer(s);
> > > +        if (s->buf_ptr < s->buf_end)
> > > +            return *s->buf_ptr;
> > > +        else
> > > +            return 0;
> > > +    }
> > 
> > if(s->buf_ptr >= s->buf_end)
> >     fill_buffer(s);
> > 
> > if (s->buf_ptr < s->buf_end){
> >     return *s->buf_ptr;
> > }else
> >     return -1;
> 
> Making this code different than url_fgetc and get_byte is just
> idiotic IMO.
> Thus below is a patch to change them to this except for the return value
> on EOF.
> And I suspect that get_byte returns 0 on EOF on purpose, I don't
> really like peek_byte and get_byte returning different values
> in that case...
> We could have url_fpeekc function that just like url_fgetc differs
> only in that aspect...
> Though if you think it will cause no issues with e.g. MPEG-demuxer
> get_byte could be changed or even removed, but I have some doubts it
> is worth risking it...
> 
> Index: aviobuf.c
> ===================================================================
> --- aviobuf.c   (revision 24303)
> +++ aviobuf.c   (working copy)

ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100725/f122692c/attachment.pgp>



More information about the ffmpeg-devel mailing list