add FF_API_URL_RESETBUF define to disable the deprecated url_resetbuf()
authorAurelien Jacobs <aurel@gnuage.org>
Thu, 19 Aug 2010 21:28:43 +0000 (21:28 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Thu, 19 Aug 2010 21:28:43 +0000 (21:28 +0000)
public function

Originally committed as revision 24841 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/avformat.h
libavformat/avio.h
libavformat/aviobuf.c

index d61e293669fd1a5a653ad34120702d0dafce113d..b95aaa46857cfea6ca6120c4151c5caae9e42d82 100644 (file)
@@ -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
index 8c5f94acb8c751e909406a2a839951c5ca3d1bcd..a33a7d98a826d4da425fade896ea27f44c4a4f70 100644 (file)
@@ -454,7 +454,7 @@ int url_fdopen(ByteIOContext **s, URLContext *h);
 
 /** @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
index 2a96f5aaa3c4f13c1ad0dc0c23f74065f2a85355..faae0891956fcdd4b9e94e4a7cb88f27176d60e0 100644 (file)
@@ -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 @@ int url_setbufsize(ByteIOContext *s, int buf_size)
     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