763d03
diff --git a/media/ffvpx/libavcodec/allcodecs.c b/media/ffvpx/libavcodec/allcodecs.c
763d03
--- a/media/ffvpx/libavcodec/allcodecs.c
763d03
+++ b/media/ffvpx/libavcodec/allcodecs.c
763d03
@@ -755,12 +755,15 @@
763d03
 extern FFCodec ff_libaom_av1_encoder;
763d03
 extern const FFCodec ff_libaribb24_decoder;
763d03
 extern const FFCodec ff_libcelt_decoder;
763d03
 extern const FFCodec ff_libcodec2_encoder;
763d03
 extern const FFCodec ff_libcodec2_decoder;
763d03
+#if CONFIG_MOZ_AV1
763d03
 extern const FFCodec ff_libdav1d_decoder;
763d03
 extern const FFCodec ff_libdavs2_decoder;
763d03
+extern const FFCodec ff_libuavs3d_decoder;
763d03
+#endif
763d03
 extern const FFCodec ff_libfdk_aac_encoder;
763d03
 extern const FFCodec ff_libfdk_aac_decoder;
763d03
 extern const FFCodec ff_libgsm_encoder;
763d03
 extern const FFCodec ff_libgsm_decoder;
763d03
 extern const FFCodec ff_libgsm_ms_encoder;
763d03
@@ -783,11 +786,10 @@
763d03
 extern const FFCodec ff_libspeex_encoder;
763d03
 extern const FFCodec ff_libspeex_decoder;
763d03
 extern const FFCodec ff_libsvtav1_encoder;
763d03
 extern const FFCodec ff_libtheora_encoder;
763d03
 extern const FFCodec ff_libtwolame_encoder;
763d03
-extern const FFCodec ff_libuavs3d_decoder;
763d03
 extern const FFCodec ff_libvo_amrwbenc_encoder;
763d03
 extern const FFCodec ff_libvorbis_encoder;
763d03
 extern const FFCodec ff_libvorbis_decoder;
763d03
 extern const FFCodec ff_libvpx_vp8_encoder;
763d03
 extern const FFCodec ff_libvpx_vp8_decoder;
763d03
diff --git a/media/ffvpx/libavcodec/codec_list.c b/media/ffvpx/libavcodec/codec_list.c
763d03
--- a/media/ffvpx/libavcodec/codec_list.c
763d03
+++ b/media/ffvpx/libavcodec/codec_list.c
763d03
@@ -9,12 +9,14 @@
763d03
     &ff_flac_decoder,
763d03
 #endif
763d03
 #if CONFIG_MP3_DECODER
763d03
     &ff_mp3_decoder,
763d03
 #endif
763d03
+#if CONFIG_MOZ_AV1
763d03
 #if CONFIG_LIBDAV1D
763d03
     &ff_libdav1d_decoder,
763d03
 #endif
763d03
 #if CONFIG_AV1_DECODER
763d03
     &ff_av1_decoder,
763d03
 #endif
763d03
+#endif
763d03
     NULL };
763d03
diff --git a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build
763d03
--- a/media/ffvpx/libavcodec/moz.build
763d03
+++ b/media/ffvpx/libavcodec/moz.build
763d03
@@ -84,11 +84,10 @@
763d03
         'cbs.c',
763d03
         'cbs_av1.c',
763d03
         'golomb.c',
763d03
         'h264pred.c',
763d03
         'imgconvert.c',
763d03
-        'libdav1d.c',
763d03
         'mathtables.c',
763d03
         'qsv_api.c',
763d03
         'raw.c',
763d03
         'videodsp.c',
763d03
         'vp8.c',
763d03
@@ -107,14 +106,19 @@
763d03
         'vp9mvs.c',
763d03
         'vp9prob.c',
763d03
         'vp9recon.c',
763d03
         'vpx_rac.c',
763d03
     ]
763d03
-    USE_LIBS += [
763d03
-        'dav1d',
763d03
-        'media_libdav1d_asm',
763d03
-    ]
763d03
+    if CONFIG['MOZ_AV1']:
763d03
+        USE_LIBS += [
763d03
+            'dav1d',
763d03
+            'media_libdav1d_asm',
763d03
+        ]
763d03
+        SOURCES += [
763d03
+            'libdav1d.c',
763d03
+        ]
763d03
+
763d03
     if CONFIG['MOZ_WAYLAND']:
763d03
         LOCAL_INCLUDES += ['/media/mozva']
763d03
         SOURCES += [
763d03
             'vaapi_av1.c',
763d03
             'vaapi_decode.c',
763d03