diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index aca1fd32721e6c47722088ef795318938091bbff..abe86759ad173c9bdb3215be3acf923612ac62c7 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -38,10 +38,10 @@
 #include "rtmppkt.h"
 
 /* we can't use av_log() with URLContext yet... */
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-#define LOG_CONTEXT NULL
-#else
+#if FF_API_URL_CLASS
 #define LOG_CONTEXT s
+#else
+#define LOG_CONTEXT NULL
 #endif
 
 //#define DEBUG