diff options
author | Benoit Fouet <benoit.fouet@free.fr> | 2009-10-20 06:40:01 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2009-10-20 06:40:01 +0000 |
commit | 08580cb05a7cd04e99f1ca4867c4d7daeb3c5e41 (patch) | |
tree | 4f21c68b366b198d2847d593d7260210946b25d4 /libavformat/aviobuf.c | |
parent | 0cd0a2248844b329c8e066f7609359ba56a9e1c6 (diff) | |
download | ffmpeg-08580cb05a7cd04e99f1ca4867c4d7daeb3c5e41.tar.gz |
Make url_resetbuf() assert on wrong flags passed and make it static on next
version bump.
See thread: [FFmpeg-devel] & vs. &&
Date: Mon, 12 Oct 2009 14:21:06 +0200
Originally committed as revision 20330 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 268326d9a8..06c7a10749 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -28,6 +28,9 @@ #define IO_BUFFER_SIZE 32768 static void fill_buffer(ByteIOContext *s); +#if LIBAVFORMAT_VERSION_MAJOR >= 53 +static int url_resetbuf(ByteIOContext *s, int flags); +#endif int init_put_byte(ByteIOContext *s, unsigned char *buffer, @@ -583,11 +586,19 @@ int url_setbufsize(ByteIOContext *s, int buf_size) return 0; } +#if LIBAVFORMAT_VERSION_MAJOR < 53 int url_resetbuf(ByteIOContext *s, int flags) +#else +static int url_resetbuf(ByteIOContext *s, int flags) +#endif { +#if LIBAVFORMAT_VERSION_MAJOR < 53 URLContext *h = s->opaque; if ((flags & URL_RDWR) || (h && h->flags != flags && !h->flags & URL_RDWR)) return AVERROR(EINVAL); +#else + assert(flags == URL_WRONLY || flags == URL_RDONLY); +#endif if (flags & URL_WRONLY) { s->buf_end = s->buffer + s->buffer_size; |