[FFmpeg-devel] Behaviour of url_read_complete
Reimar Döffinger
Reimar.Doeffinger
Fri Jan 22 23:13:25 CET 2010
On Fri, Jan 22, 2010 at 09:23:25PM +0100, Michael Niedermayer wrote:
> On Fri, Jan 22, 2010 at 09:14:36PM +0100, Reimar D?ffinger wrote:
> > On Fri, Jan 22, 2010 at 07:33:23PM +0100, Reimar D?ffinger wrote:
> > > Hello,
> > > I am a bit unsure about the purpose of url_read_complete.
> > > However I would find it more convenient if its behaviour was as
> > > with patch below.
> > > What are your opinions?
> > > The users of it in FFmpeg I saw would still work with that change.
> > > Index: avio.c
> > > ===================================================================
> > > --- avio.c (revision 21107)
> > > +++ avio.c (working copy)
> > > @@ -156,8 +156,8 @@
> > > len = 0;
> > > while (len < size) {
> > > ret = url_read(h, buf+len, size-len);
> > > - if (ret < 1)
> > > - return ret;
> > > + if (ret < 1 && ret != AVERROR(EAGAIN))
> > > + return ret < 0 ? ret : len;
> > > len += ret;
> > > }
> >
> > The EAGAIN handling is obviously wrong, but I hope you get the idea I had in mind.
>
> if you think ignoring EAGAIN is what most users would want then
> iam not opposed
Well, the other point was to return the length of the data read
even if it is < size - currently it returns 0 when len is < size
when the read returns 0.
More information about the ffmpeg-devel
mailing list