[FFmpeg-devel] [PATCH 3/5] ff_network_wait_fd_timeout(): check for interrupt before operation

Lukasz M lukasz.m.luki at gmail.com
Thu Jul 11 00:26:59 CEST 2013


>      while (1) {
> +        if (ff_check_interrupt(int_cb))
> +            return AVERROR_EXIT;
>          ret = ff_network_wait_fd(fd, write);
>          if (ret != AVERROR(EAGAIN))
>              return ret;
> -        if (ff_check_interrupt(int_cb))
> -            return AVERROR_EXIT;
>          if (timeout > 0) {
>              if (!wait_start)
>                  wait_start = av_gettime();

I was struggling the same fragment of code, during FTP protocol implementation.
Not quite sure, but doesn't it make tcp protocol returning even though
there is some data available?
I was thinking about making ff_network_wait_fd timeout 0 in case
ff_check_interrupt returns positive.

If I'm wrong then ignore, I haven't checked it deeply.

Best regards,
Lukasz Marek


More information about the ffmpeg-devel mailing list