--- gst-libav-1.16.1/ext/libav/gstavviddec.c.orig	2023-09-04 19:45:19.842962877 +0600
+++ gst-libav-1.16.1/ext/libav/gstavviddec.c	2023-09-04 19:46:29.250511930 +0600
@@ -34,6 +34,10 @@
 
 GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
 
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100)
+#define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS
+#endif
+
 #define MAX_TS_MASK 0xff
 
 #define DEFAULT_LOWRES			0
@@ -493,7 +497,7 @@
     gboolean is_live;
 
     if (ffmpegdec->max_threads == 0) {
-      if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS))
+      if (!(oclass->in_plugin->capabilities & AV_CODEC_CAP_OTHER_THREADS))
         ffmpegdec->context->thread_count = gst_ffmpeg_auto_max_threads ();
       else
         ffmpegdec->context->thread_count = 0;
