[FFmpeg-cvslog] avio: fix AVIO_FLAG_READ/WRITE test in ffurl_*.

Nicolas George git at videolan.org
Wed Apr 20 20:36:47 CEST 2011


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Apr 20 18:13:54 2011 +0200| [b9553cf4b80d79c280ae7c989593ce1daac4cafa] | committer: Nicolas George

avio: fix AVIO_FLAG_READ/WRITE test in ffurl_*.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9553cf4b80d79c280ae7c989593ce1daac4cafa
---

 libavformat/avio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 0a09cf1..936a3d9 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -287,14 +287,14 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
 
 int ffurl_read(URLContext *h, unsigned char *buf, int size)
 {
-    if (h->flags & AVIO_FLAG_WRITE)
+    if (!(h->flags & AVIO_FLAG_READ))
         return AVERROR(EIO);
     return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
 }
 
 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
 {
-    if (h->flags & AVIO_FLAG_WRITE)
+    if (!(h->flags & AVIO_FLAG_READ))
         return AVERROR(EIO);
     return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read);
 }



More information about the ffmpeg-cvslog mailing list