diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-15 18:42:09 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-04-19 21:47:58 +0400 |
commit | 59d96941f0285a501989d5f2c9b69be0a1393ed5 (patch) | |
tree | 8a8df3842d20ac6543309dc4063376bf50580944 /libavformat/aviobuf.c | |
parent | 490a022d86ef1c506a79744c5a95368af356fc69 (diff) |
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/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 2bacedbaa7..2b14d48ff5 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -53,7 +53,7 @@ int ffio_init_context(AVIOContext *s, s->buffer_size = buffer_size; s->buf_ptr = buffer; s->opaque = opaque; - url_resetbuf(s, write_flag ? AVIO_WRONLY : AVIO_RDONLY); + url_resetbuf(s, write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ); s->write_packet = write_packet; s->read_packet = read_packet; s->seek = seek; @@ -843,7 +843,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) } if (ffio_init_context(*s, buffer, buffer_size, - (h->flags & AVIO_WRONLY || h->flags & AVIO_RDWR), h, + h->flags & AVIO_FLAG_WRITE, h, ffurl_read, ffurl_write, ffurl_seek) < 0) { av_free(buffer); av_freep(s); @@ -872,15 +872,15 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size) s->buffer = buffer; s->buffer_size = buf_size; s->buf_ptr = buffer; - url_resetbuf(s, s->write_flag ? AVIO_WRONLY : AVIO_RDONLY); + url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ); return 0; } static int url_resetbuf(AVIOContext *s, int flags) { - assert(flags == AVIO_WRONLY || flags == AVIO_RDONLY); + assert(flags == AVIO_FLAG_WRITE || flags == AVIO_FLAG_READ); - if (flags & AVIO_WRONLY) { + if (flags & AVIO_FLAG_WRITE) { s->buf_end = s->buffer + s->buffer_size; s->write_flag = 1; } else { @@ -1038,7 +1038,7 @@ int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags) if(!*s) return AVERROR(ENOMEM); ret = ffio_init_context(*s, buf, buf_size, - (flags & AVIO_WRONLY || flags & AVIO_RDWR), + flags & AVIO_FLAG_WRITE, NULL, NULL, NULL, NULL); if(ret != 0) av_freep(s); |