diff --git a/libavformat/utils.c b/libavformat/utils.c
index 74b96472831d4bc19371dd64325ca34e0ab1daf0..29b09cf3f32dd56b5f56daf4ce64ab50722dabd0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -344,7 +344,7 @@ static const AVOption options[]={
 
 static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options };
 
-#if LIBAVCODEC_VERSION_INT > ((52<<16)+(0<<8)+0)
+#if LIBAVFORMAT_VERSION_INT >= ((51<<16)+(0<<8)+0)
 static
 #endif
 void avformat_get_context_defaults(AVFormatContext *s){