[FFmpeg-devel] UDP Timeout

Michael Niedermayer michaelni at gmx.at
Sun Jun 5 23:39:04 CEST 2011


On Sun, Jun 05, 2011 at 11:34:20PM +0200, Michael Niedermayer wrote:
> 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

btw, this is with "ffmpeg    -i udp://127.0.0.1?localport=1111 -y out.avi </dev/null &"

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- 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/d2f3fbc8/attachment.asc>


More information about the ffmpeg-devel mailing list