[FFmpeg-cvslog] r26318 - trunk/libavformat/aviobuf.c

Nicolas George nicolas.george
Wed Jan 12 11:04:41 CET 2011


Le tridi 23 niv?se, an CCXIX, Martin Storsj? a ?crit?:
> This seems to have broken rtpdec_asf, where the chained asf demuxer is 
> supposed to break and return cleanly on AVERROR(EAGAIN), which now is 
> swallowed in the ByteIOContext layer.
> 
> Is there any better error code that could be used in rtpdec_asf/asfdec for 
> indicating that there is no more data to return at the moment, but the 
> stream isn't finished yet.

That is _exactly_ what EAGAIN means.

IMHO, looping on EAGAIN is just WRONG. EAGAIN happens when something has
been set in non-blocking mode: if we do not want EAGAIN, we just do not set
non-blocking mode. And on the other hand, if someone set non-blocking mode,
that's because he wants to see EAGAIN to be able to do something else in the
meantime.

Looping on EAGAIN is just burning CPU doing busy-wait for absolutely no good
reason.

I think some people around here have confused EAGAIN for EINTR: system calls
must loop in case of EINTR, not EAGAIN.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20110112/9081d8cd/attachment.pgp>



More information about the ffmpeg-cvslog mailing list