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

Michael Niedermayer michaelni
Thu Oct 1 23:32:41 CEST 2009


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)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091001/fc55e249/attachment.pgp>



More information about the ffmpeg-devel mailing list