diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index 35bbc186361d38049b6c0cb0d5b622e1e2e7d745..4ef655d563764eecd52207a37ac0eb3e53c7741d 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -251,6 +251,8 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
                 break;
             }
         } else if (n < 0) {
+            if (ff_neterrno() == FF_NETERROR(EINTR))
+                continue;
             return AVERROR(EIO);
         }
     }
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index ae846a4c37022c1415926287ef441f89ddbb039b..79cabdfe903debf660479813334a1b4612520a9f 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -147,6 +147,8 @@ static int tcp_read(URLContext *h, uint8_t *buf, int size)
                     return AVERROR(ff_neterrno());
             } else return len;
         } else if (ret < 0) {
+            if (ff_neterrno() == FF_NETERROR(EINTR))
+                continue;
             return -1;
         }
     }
@@ -180,6 +182,8 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size)
             size -= len;
             buf += len;
         } else if (ret < 0) {
+            if (ff_neterrno() == FF_NETERROR(EINTR))
+                continue;
             return -1;
         }
     }
diff --git a/libavformat/udp.c b/libavformat/udp.c
index dc896a43f1cd83469643cdc54c734caf1b87bfb0..84bca7b0d3f3fdac910e3d3379913c8e01a8cda3 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -437,8 +437,11 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
         tv.tv_sec = 0;
         tv.tv_usec = 100 * 1000;
         ret = select(s->udp_fd + 1, &rfds, NULL, NULL, &tv);
-        if (ret < 0)
+        if (ret < 0) {
+            if (ff_neterrno() == FF_NETERROR(EINTR))
+                continue;
             return AVERROR(EIO);
+        }
         if (!(ret > 0 && FD_ISSET(s->udp_fd, &rfds)))
             continue;
         len = recv(s->udp_fd, buf, size, 0);