diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-15 16:42:09 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-04-19 19:47:58 +0200 |
commit | 59d96941f0285a501989d5f2c9b69be0a1393ed5 (patch) | |
tree | 8a8df3842d20ac6543309dc4063376bf50580944 /libavformat/avio.c | |
parent | 490a022d86ef1c506a79744c5a95368af356fc69 (diff) | |
download | ffmpeg-59d96941f0285a501989d5f2c9b69be0a1393ed5.tar.gz |
avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols
Make AVIO_FLAG_ access constants work as flags, and in particular fix
the behavior of functions (such as avio_check()) which expect them to
be flags rather than modes.
This breaks API.
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 4f8acb01ff..074d3eeb86 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -129,7 +129,7 @@ int ffurl_connect(URLContext* uc) return err; uc->is_connected = 1; //We must be careful here as ffurl_seek() could be slow, for example for http - if( (uc->flags & (AVIO_WRONLY | AVIO_RDWR)) + if( (uc->flags & AVIO_FLAG_WRITE) || !strcmp(uc->prot->name, "file")) if(!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0) uc->is_streamed= 1; @@ -289,21 +289,21 @@ 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_WRONLY) + if (h->flags & AVIO_FLAG_WRITE) 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_WRONLY) + if (h->flags & AVIO_FLAG_WRITE) return AVERROR(EIO); return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read); } int ffurl_write(URLContext *h, const unsigned char *buf, int size) { - if (!(h->flags & (AVIO_WRONLY | AVIO_RDWR))) + if (!(h->flags & AVIO_FLAG_WRITE)) return AVERROR(EIO); /* avoid sending too big packets */ if (h->max_packet_size && size > h->max_packet_size) @@ -342,7 +342,7 @@ int ffurl_close(URLContext *h) int url_exist(const char *filename) { URLContext *h; - if (ffurl_open(&h, filename, AVIO_RDONLY) < 0) + if (ffurl_open(&h, filename, AVIO_FLAG_READ) < 0) return 0; ffurl_close(h); return 1; |