[FFmpeg-devel] [PATCH] libavformat: Don't return errors if select is interrupted

Martin Storsjö martin
Mon Mar 22 20:58:15 CET 2010


On Mon, 22 Mar 2010, Luca Abeni wrote:

> not sure if the ping was to me or to Ronald, anyway...

I guess i meant both of you :-)

> On Mon, 2010-03-22 at 20:56 +0200, Martin Storsj? wrote:
> [...]
> > > On Fri, 5 Mar 2010, Luca Abeni wrote:
> > > 
> > > > I think the idea was to let the application cope with EINTR and EAGAIN,
> > > > but I might be misremembering (and I have no strong opinions on it :)
> > > 
> > > Yes, assuming that all the code (between the lowest level protocol 
> > > receiving the data and the original av_read_frame call from the user 
> > > application) is ready to handle EINTR/EAGAIN properly, that's probably the 
> > > best solution.
> > > 
> > > One problem is that a very large portion of the code don't pass the 
> > > original error codes through properly but simply return AVERROR(EIO) if 
> > > something occurred.
> 
> I think this part should be fixed. I mean, the code should pass the
> original error, not change it in EIO...

Yes, that should be done, but that's quite a monumental task.

> > > Another problem is that code reading a few bytes at a time seldom is ready 
> > > to actually be interrupted at any time, return an error code and then 
> > > continue properly when called the next time again.
> [...]
> 
> Ok; I did not consider this... If returning EINTR is not possible
> without breaking many demuxers, then I think your patch is a good idea
> (maybe with a comment explaining why EINTR is not passed to the
> caller... When all the demuxers will be fixed, we could remove this
> hack). Just an opinion...

Exactly, when all of lavf (or "only" the parts that can interact with 
network protocols) can handle interruptions at any place, these kinds of 
interruption hiding can be removed.

// Martin



More information about the ffmpeg-devel mailing list