# HG changeset patch # User aurel # Date 1282253323 0 # Node ID 89cf0940e3f014473f61192f5866c6a3cbdd10e8 # Parent 896acb967d32b745bc33d749dc61101dcd2a4db0 add FF_API_URL_RESETBUF define to disable the deprecated url_resetbuf() public function diff -r 896acb967d32 -r 89cf0940e3f0 avformat.h --- a/avformat.h Thu Aug 19 21:21:32 2010 +0000 +++ b/avformat.h Thu Aug 19 21:28:43 2010 +0000 @@ -48,6 +48,9 @@ #ifndef FF_API_URL_CLASS #define FF_API_URL_CLASS (LIBAVFORMAT_VERSION_MAJOR >= 53) #endif +#ifndef FF_API_URL_RESETBUF +#define FF_API_URL_RESETBUF (LIBAVFORMAT_VERSION_MAJOR < 53) +#endif #ifndef FF_API_REGISTER_PROTOCOL #define FF_API_REGISTER_PROTOCOL (LIBAVFORMAT_VERSION_MAJOR < 53) #endif diff -r 896acb967d32 -r 89cf0940e3f0 avio.h --- a/avio.h Thu Aug 19 21:21:32 2010 +0000 +++ b/avio.h Thu Aug 19 21:28:43 2010 +0000 @@ -454,7 +454,7 @@ /** @warning must be called before any I/O */ int url_setbufsize(ByteIOContext *s, int buf_size); -#if LIBAVFORMAT_VERSION_MAJOR < 53 +#if FF_API_URL_RESETBUF /** Reset the buffer for reading or writing. * @note Will drop any data currently in the buffer without transmitting it. * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY diff -r 896acb967d32 -r 89cf0940e3f0 aviobuf.c --- a/aviobuf.c Thu Aug 19 21:21:32 2010 +0000 +++ b/aviobuf.c Thu Aug 19 21:28:43 2010 +0000 @@ -36,7 +36,7 @@ #define SHORT_SEEK_THRESHOLD 4096 static void fill_buffer(ByteIOContext *s); -#if LIBAVFORMAT_VERSION_MAJOR >= 53 +#if !FF_API_URL_RESETBUF static int url_resetbuf(ByteIOContext *s, int flags); #endif @@ -632,13 +632,13 @@ return 0; } -#if LIBAVFORMAT_VERSION_MAJOR < 53 +#if FF_API_URL_RESETBUF int url_resetbuf(ByteIOContext *s, int flags) #else static int url_resetbuf(ByteIOContext *s, int flags) #endif { -#if LIBAVFORMAT_VERSION_MAJOR < 53 +#if FF_API_URL_RESETBUF if (flags & URL_RDWR) return AVERROR(EINVAL); #else