Only use AV_CODEC_ID_WRAPPED_AVFRAME on new enough libavcodecs
authorIain Lane <iain@orangesquash.org.uk>
Fri, 2 Sep 2016 15:55:46 +0000 (16:55 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 3 Sep 2016 11:20:26 +0000 (14:20 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=770753

ext/libav/gstavviddec.c
ext/libav/gstavvidenc.c

index 8aabcb1..71310ec 100644 (file)
@@ -2044,8 +2044,11 @@ gst_ffmpegviddec_register (GstPlugin * plugin)
         || in_plugin->id == AV_CODEC_ID_Y41P
         || in_plugin->id == AV_CODEC_ID_012V
         || in_plugin->id == AV_CODEC_ID_YUV4
-        || in_plugin->id == AV_CODEC_ID_ZLIB
-        || in_plugin->id == AV_CODEC_ID_WRAPPED_AVFRAME) {
+#if AV_VERSION_INT (LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) >= \
+        AV_VERSION_INT (57,4,0)
+        || in_plugin->id == AV_CODEC_ID_WRAPPED_AVFRAME
+#endif
+        || in_plugin->id == AV_CODEC_ID_ZLIB) {
       goto next;
     }
 
index 9fb7f64..2ec32d8 100644 (file)
@@ -966,8 +966,11 @@ gst_ffmpegvidenc_register (GstPlugin * plugin)
         || in_plugin->id == AV_CODEC_ID_Y41P
         || in_plugin->id == AV_CODEC_ID_012V
         || in_plugin->id == AV_CODEC_ID_YUV4
-        || in_plugin->id == AV_CODEC_ID_ZLIB
-        || in_plugin->id == AV_CODEC_ID_WRAPPED_AVFRAME) {
+#if AV_VERSION_INT (LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) >= \
+        AV_VERSION_INT (57,4,0)
+        || in_plugin->id == AV_CODEC_ID_WRAPPED_AVFRAME
+#endif
+        || in_plugin->id == AV_CODEC_ID_ZLIB) {
       goto next;
     }