diff --git a/libavformat/tls.c b/libavformat/tls.c
index bd73febd4d9530494a9d4f46b85d13f3453a6d7a..f89a717b7ad165571f29f2f660b09c5496723368 100644
--- a/libavformat/tls.c
+++ b/libavformat/tls.c
@@ -91,7 +91,7 @@ static int do_tls_poll(URLContext *h, int ret)
         return AVERROR(EIO);
     }
 #endif
-    if (h->flags & URL_FLAG_NONBLOCK)
+    if (h->flags & AVIO_FLAG_NONBLOCK)
         return AVERROR(EAGAIN);
     while (1) {
         int n = poll(&p, 1, 100);