[FFmpeg-devel] [PATCH] libavformat/network: Fixed wait timeout functionality to exit immediately when timeout is 0.

rpatagar at akamai.com rpatagar at akamai.com
Fri Feb 16 08:54:09 EET 2018


From: Ravindra <rpatagar at akamai.com>

Signed-off-by: Ravindra <rpatagar at akamai.com>
---
 libavformat/network.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index d5c82e9..542bd3e 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -85,7 +85,9 @@ int ff_network_wait_fd_timeout(int fd, int write, int64_t timeout, AVIOInterrupt
         ret = ff_network_wait_fd(fd, write);
         if (ret != AVERROR(EAGAIN))
             return ret;
-        if (timeout > 0) {
+        if (!timeout) {
+            return AVERROR(ETIMEDOUT);
+        } else if (timeout > 0) {
             if (!wait_start)
                 wait_start = av_gettime_relative();
             else if (av_gettime_relative() - wait_start > timeout)
-- 
1.9.1



More information about the ffmpeg-devel mailing list