[FFmpeg-devel] [PATCH] make av_get_packet return AVERROR_EOF if appropriate

Reimar Döffinger Reimar.Doeffinger
Fri Oct 2 09:07:32 CEST 2009


On Thu, Oct 01, 2009 at 11:32:41PM +0200, Michael Niedermayer wrote:
> On Thu, Oct 01, 2009 at 10:21:04PM +0200, Reimar D?ffinger wrote:
> > On Thu, Oct 01, 2009 at 09:20:54PM +0200, Michael Niedermayer wrote:
> > > On Thu, Oct 01, 2009 at 07:15:06PM +0200, Reimar D?ffinger wrote:
> > > > I propose this change to get_buffer:
> > > > Index: libavformat/aviobuf.c
> > > > ===================================================================
> > > > --- libavformat/aviobuf.c       (revision 20105)
> > > > +++ libavformat/aviobuf.c       (working copy)
> > > > @@ -415,6 +415,8 @@
> > > >              size -= len;
> > > >          }
> > > >      }
> > > > +    if (size1 == size && url_feof(s))
> > > > +        return AVERROR_EOF;
> > > >      return size1 - size;
> > > >  }
> > > >  
> > > 
> > > this would return EOF even if EIO happened
> > > url_ferror() should maybe be considered or eof not set in case of other
> > > errors
> > 
> > I wasn't even aware of url_ferror. Seems preferable to me to make those
> > errors available as return value when possible.
> > I admit it isn't great but I have the impression that currently almost
> > nothing takes care of url_ferror, so that should at least be a slight
> > improvement.
> 
> patch looks good (assuming reg tests pass)

Except for the verified-correct changes (aiff and au) they do.
All applied.



More information about the ffmpeg-devel mailing list