[FFmpeg-devel] UDP Timeout

Michael Niedermayer michaelni at gmx.at
Sun Jun 5 23:34:20 CEST 2011


On Sun, Jun 05, 2011 at 09:10:03PM +0100, JULIAN GARDNER wrote:
[...]
> The first timeout sorry is unneeded.
> 
> Ok here goes, timeout = 10;
> 
> >>               avail = av_fifo_size(s->fifo);
> >>               if (avail) { // >=size) {
> >>                   // Maximum amount available
> >>                   size = FFMIN( avail, size);
> >>                   av_fifo_generic_read(s->fifo, buf, size, NULL);
> >>                   return size;
> >>               }
> >>               else {
> 
> // avail = 0; no data available in fifo
> 
> >>  +                if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
> >>  +                    ret = ff_network_wait_fd(s->udp_fd, 0);
> >>  +                    if (ret < 0)
> 
> // Only return on network error, if still no data after timeout we drop down to the "while( --timeout)"

for me it returns -11 (EAGAIN)
also
with the patch the code fails instantly with
Udp data available 0
udp://127.0.0.1?localport=1111: Inappropriate ioctl for device

it does not do so prior to the patch

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110605/db9c7d52/attachment.asc>


More information about the ffmpeg-devel mailing list