changeset 6394:896acb967d32 libavformat

add FF_API_REGISTER_PROTOCOL define to disable the deprecated register_protocol() function
author aurel
date Thu, 19 Aug 2010 21:21:32 +0000
parents 98bbeb6188e5
children 89cf0940e3f0
files avformat.h avio.c avio.h
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/avformat.h	Thu Aug 19 17:07:12 2010 +0000
+++ b/avformat.h	Thu Aug 19 21:21:32 2010 +0000
@@ -48,6 +48,9 @@
 #ifndef FF_API_URL_CLASS
 #define FF_API_URL_CLASS     (LIBAVFORMAT_VERSION_MAJOR >= 53)
 #endif
+#ifndef FF_API_REGISTER_PROTOCOL
+#define FF_API_REGISTER_PROTOCOL  (LIBAVFORMAT_VERSION_MAJOR < 53)
+#endif
 
 /**
  * I return the LIBAVFORMAT_VERSION_INT constant.  You got
--- a/avio.c	Thu Aug 19 17:07:12 2010 +0000
+++ b/avio.c	Thu Aug 19 21:21:32 2010 +0000
@@ -71,7 +71,7 @@
     return 0;
 }
 
-#if LIBAVFORMAT_VERSION_MAJOR < 53
+#if FF_API_REGISTER_PROTOCOL
 /* The layout of URLProtocol as of when major was bumped to 52 */
 struct URLProtocol_compat {
     const char *name;
--- a/avio.h	Thu Aug 19 17:07:12 2010 +0000
+++ b/avio.h	Thu Aug 19 21:21:32 2010 +0000
@@ -256,7 +256,7 @@
     const AVClass *priv_data_class;
 } URLProtocol;
 
-#if LIBAVFORMAT_VERSION_MAJOR < 53
+#if FF_API_REGISTER_PROTOCOL
 extern URLProtocol *first_protocol;
 #endif
 
@@ -269,7 +269,7 @@
  */
 URLProtocol *av_protocol_next(URLProtocol *p);
 
-#if LIBAVFORMAT_VERSION_MAJOR < 53
+#if FF_API_REGISTER_PROTOCOL
 /**
  * @deprecated Use av_register_protocol() instead.
  */