[FFmpeg-devel] [RFC] more intelligent EAGAIN handling in url_read_complete

Michael Niedermayer michaelni
Sun Jan 24 14:27:47 CET 2010

On Sun, Jan 24, 2010 at 11:51:38AM +0100, Reimar D?ffinger wrote:
> Hello,
> not sure if this is overkill, but this improves EAGAIN handling
> in url_read_complete:
> It will retry reading in quick succession for the first 5 times
> it receives EAGAIN and sleep if it still gets EAGAIN.
> Each time some data is read successfully, it will increase the
> counter to at least two fast retries.
> The numbers (5 and 2) are rather arbitrary, though I think they
> should be appropriate for fast handling of EAGAIN in case it happens
> for some other reason than data not being ready while not using
> insane amounts of CPU if the reads happen to be to some non-blocking source
> (even though it does not usually make sense to use url_read_complete
> on non-blocking sources).

>  avio.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 9ed8b459e37206b4a3f5b2463181e4687040f108  eagain.diff

do as you prefer, but i expect you to maintain the changed code if
you commit this

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- 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/20100124/55429c71/attachment.pgp>

More information about the ffmpeg-devel mailing list