slackware-current/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch
Patrick J Volkerding 1af8dbc03d Mon Oct 10 18:45:33 UTC 2022
ap/diffstat-1.65-x86_64-1.txz:  Upgraded.
ap/moc-2.6_alpha3-x86_64-1.txz:  Upgraded.
  Compiled against ffmpeg-5.1.2.
kde/attica-5.99.0-x86_64-1.txz:  Upgraded.
kde/baloo-5.99.0-x86_64-1.txz:  Upgraded.
kde/bluez-qt-5.99.0-x86_64-1.txz:  Upgraded.
kde/breeze-icons-5.99.0-noarch-1.txz:  Upgraded.
kde/digikam-7.8.0-x86_64-3.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
kde/extra-cmake-modules-5.99.0-x86_64-1.txz:  Upgraded.
kde/ffmpegthumbs-22.08.1-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
kde/frameworkintegration-5.99.0-x86_64-1.txz:  Upgraded.
kde/kactivities-5.99.0-x86_64-1.txz:  Upgraded.
kde/kactivities-stats-5.99.0-x86_64-1.txz:  Upgraded.
kde/kapidox-5.99.0-x86_64-1.txz:  Upgraded.
kde/karchive-5.99.0-x86_64-1.txz:  Upgraded.
kde/kauth-5.99.0-x86_64-1.txz:  Upgraded.
kde/kbookmarks-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcalendarcore-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcmutils-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcodecs-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcompletion-5.99.0-x86_64-1.txz:  Upgraded.
kde/kconfig-5.99.0-x86_64-1.txz:  Upgraded.
kde/kconfigwidgets-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcontacts-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcoreaddons-5.99.0-x86_64-1.txz:  Upgraded.
kde/kcrash-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdav-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdbusaddons-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdeclarative-5.99.0-x86_64-1.txz:  Upgraded.
kde/kded-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdelibs4support-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdesignerplugin-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdesu-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdewebkit-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdnssd-5.99.0-x86_64-1.txz:  Upgraded.
kde/kdoctools-5.99.0-x86_64-1.txz:  Upgraded.
kde/kemoticons-5.99.0-x86_64-1.txz:  Upgraded.
kde/kfilemetadata-5.99.0-x86_64-1.txz:  Upgraded.
  Compiled against ffmpeg-5.1.2.
kde/kglobalaccel-5.99.0-x86_64-1.txz:  Upgraded.
kde/kguiaddons-5.99.0-x86_64-1.txz:  Upgraded.
kde/kholidays-5.99.0-x86_64-1.txz:  Upgraded.
kde/khtml-5.99.0-x86_64-1.txz:  Upgraded.
kde/ki18n-5.99.0-x86_64-1.txz:  Upgraded.
kde/kiconthemes-5.99.0-x86_64-1.txz:  Upgraded.
kde/kidletime-5.99.0-x86_64-1.txz:  Upgraded.
kde/kimageformats-5.99.0-x86_64-1.txz:  Upgraded.
kde/kinit-5.99.0-x86_64-1.txz:  Upgraded.
kde/kio-5.99.0-x86_64-1.txz:  Upgraded.
kde/kirigami2-5.99.0-x86_64-1.txz:  Upgraded.
kde/kitemmodels-5.99.0-x86_64-1.txz:  Upgraded.
kde/kitemviews-5.99.0-x86_64-1.txz:  Upgraded.
kde/kjobwidgets-5.99.0-x86_64-1.txz:  Upgraded.
kde/kjs-5.99.0-x86_64-1.txz:  Upgraded.
kde/kjsembed-5.99.0-x86_64-1.txz:  Upgraded.
kde/kmediaplayer-5.99.0-x86_64-1.txz:  Upgraded.
kde/knewstuff-5.99.0-x86_64-1.txz:  Upgraded.
kde/knotifications-5.99.0-x86_64-1.txz:  Upgraded.
kde/knotifyconfig-5.99.0-x86_64-1.txz:  Upgraded.
kde/kpackage-5.99.0-x86_64-1.txz:  Upgraded.
kde/kparts-5.99.0-x86_64-1.txz:  Upgraded.
kde/kpeople-5.99.0-x86_64-1.txz:  Upgraded.
kde/kplotting-5.99.0-x86_64-1.txz:  Upgraded.
kde/kpty-5.99.0-x86_64-1.txz:  Upgraded.
kde/kquickcharts-5.99.0-x86_64-1.txz:  Upgraded.
kde/kross-5.99.0-x86_64-1.txz:  Upgraded.
kde/krunner-5.99.0-x86_64-1.txz:  Upgraded.
kde/kservice-5.99.0-x86_64-1.txz:  Upgraded.
kde/ktexteditor-5.99.0-x86_64-1.txz:  Upgraded.
kde/ktextwidgets-5.99.0-x86_64-1.txz:  Upgraded.
kde/kunitconversion-5.99.0-x86_64-1.txz:  Upgraded.
kde/kwallet-5.99.0-x86_64-1.txz:  Upgraded.
kde/kwayland-5.99.0-x86_64-1.txz:  Upgraded.
kde/kwidgetsaddons-5.99.0-x86_64-1.txz:  Upgraded.
kde/kwindowsystem-5.99.0-x86_64-1.txz:  Upgraded.
kde/kxmlgui-5.99.0-x86_64-1.txz:  Upgraded.
kde/kxmlrpcclient-5.99.0-x86_64-1.txz:  Upgraded.
kde/modemmanager-qt-5.99.0-x86_64-1.txz:  Upgraded.
kde/networkmanager-qt-5.99.0-x86_64-1.txz:  Upgraded.
kde/oxygen-icons5-5.99.0-noarch-1.txz:  Upgraded.
kde/plasma-framework-5.99.0-x86_64-1.txz:  Upgraded.
kde/prison-5.99.0-x86_64-1.txz:  Upgraded.
kde/purpose-5.99.0-x86_64-1.txz:  Upgraded.
kde/qqc2-desktop-style-5.99.0-x86_64-1.txz:  Upgraded.
kde/solid-5.99.0-x86_64-1.txz:  Upgraded.
kde/sonnet-5.99.0-x86_64-1.txz:  Upgraded.
kde/syndication-5.99.0-x86_64-1.txz:  Upgraded.
kde/syntax-highlighting-5.99.0-x86_64-1.txz:  Upgraded.
kde/threadweaver-5.99.0-x86_64-1.txz:  Upgraded.
l/QtAV-20220226_fdc613dc-x86_64-1.txz:  Upgraded.
  Compiled against ffmpeg-5.1.2.
l/alsa-plugins-1.2.7.1-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
l/ffmpeg-5.1.2-x86_64-1.txz:  Upgraded.
  Shared library .so-version bump.
  Enabled glslang and vulkan. Thanks to Heinz Wiesinger.
l/gegl-0.4.38-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
l/gst-plugins-libav-1.20.3-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
l/harfbuzz-5.3.0-x86_64-1.txz:  Upgraded.
l/imagemagick-7.1.0_50-x86_64-1.txz:  Upgraded.
l/libvncserver-0.9.13-x86_64-4.txz:  Rebuilt.
  Disabled ffmpeg support (not compatible with ffmpeg5).
l/mlt-7.8.0-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
l/opencv-4.6.0-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
l/pcre2-10.40-x86_64-2.txz:  Rebuilt.
  Moved shared libraries into /lib${LIBDIRSUFFIX}. Thanks to TommyC7.
l/pipewire-0.3.59-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
l/qt5-5.15.6_20220928_06b700dd-x86_64-1.txz:  Upgraded.
  Compiled against ffmpeg-5.1.2.
n/libgpg-error-1.46-x86_64-2.txz:  Rebuilt.
  Rebuilt with --enable-install-gpg-error-config to fix regression building
  gpgme. Thanks to nobodino and ponce.
x/libva-utils-2.16.0-x86_64-1.txz:  Upgraded.
x/wayland-protocols-1.27-noarch-1.txz:  Upgraded.
xap/MPlayer-20221009-x86_64-1.txz:  Upgraded.
  Compiled against ffmpeg-5.1.2.
xap/audacious-plugins-4.2-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
xap/ffmpegthumbnailer-2.2.2-x86_64-4.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
xap/freerdp-2.8.0-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
xap/ssr-0.4.4-x86_64-1.txz:  Upgraded.
  Compiled against ffmpeg-5.1.2.
xap/xine-lib-1.2.12-x86_64-2.txz:  Rebuilt.
  Recompiled against ffmpeg-5.1.2.
2022-10-11 07:00:35 +02:00

330 lines
12 KiB
Diff

--- a/m4/decoders.m4
+++ b/m4/decoders.m4
@@ -134,13 +134,36 @@ a52_init ();
AC_DEFINE([HAVE_FFMPEG], 1, [Define this if you have the ffmpeg library])
dnl Check presence of ffmpeg/avutil.h to see if it's old or new
dnl style for headers. The new style would be preferred actually...
+ dnl Sigh. at least some 09/2022 ffmpeg version does violate the basic
+ dnl "get directly what you use directly" rule. especially,
+ dnl libavformat/avformat.h includes libavcodec/packet.h which uses
+ dnl (but not includes) libavutil/avutil.h. this means that a mere
+ dnl AC_CHECK_HEADERS([libavformat/avformat.h]) will fail strangely :-/
ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $FFMPEG_CFLAGS"
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CFLAGS $FFMPEG_CFLAGS $AVUTIL_CFLAGS"
- AC_CHECK_HEADERS([ffmpeg/avutil.h])
- AC_CHECK_HEADERS([libavutil/avutil.h])
- AC_CHECK_HEADERS([libavutil/sha1.h])
- AC_CHECK_HEADERS([libavutil/sha.h])
+ AC_CHECK_HEADERS([ffmpeg/avutil.h libavutil/avutil.h libavutil/sha1.h libavutil/mem.h libavutil/sha.h])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
+ ]],[[]])], [have_avutil_avcodec_h=yes], [have_avutil_avcodec_h=no])
+ test x"$have_avutil_avcodec_h" == x"yes" && AC_DEFINE([HAVE_AVUTIL_AVCODEC_H],[1],
+ [Define this if you have libavutil/avutil.h and libavcodec/avcodec.h.])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+ ]],[[]])], [have_avformat_avformat_h=yes], [have_avformat_avformat_h=no])
+ test x"$have_avformat_avformat_h" == x"yes" && AC_DEFINE([HAVE_AVFORMAT_AVFORMAT_H],[1],
+ [Define this if you have libavformat/avformat.h.])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libavformat/avio.h>
+ ]],[[]])], [have_avformat_avio_h=yes], [have_avformat_avio_h=no])
+ test x"$have_avformat_avio_h" == x"yes" && AC_DEFINE([HAVE_AVFORMAT_AVIO_H],[1],
+ [Define this if you have libavformat/avformat.h.])
if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then
AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!])
fi
--- a/m4/input.m4
+++ b/m4/input.m4
@@ -229,6 +229,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [
fi
if test x"$have_avformat" = x"yes"; then
AC_DEFINE([HAVE_AVFORMAT], 1, [Define this if you have libavformat installed])
+ AC_CHECK_HEADERS([libavformat/avformat.h])
fi
fi
AM_CONDITIONAL([ENABLE_AVFORMAT], [test x"$have_avformat" = x"yes"])
--- a/src/combined/ffmpeg/demux_avformat.c
+++ b/src/combined/ffmpeg/demux_avformat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2021 the xine project
+ * Copyright (C) 2013-2022 the xine project
* Copyright (C) 2013-2020 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This file is part of xine, a free video player.
@@ -29,6 +29,8 @@
#include <pthread.h>
#include <errno.h>
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
@@ -922,3 +924,4 @@ void *init_avformat_demux_plugin (xine_t
(void)data;
return (demux_class_t *)&this;
}
+
--- a/src/combined/ffmpeg/ff_audio_decoder.c
+++ b/src/combined/ffmpeg/ff_audio_decoder.c
@@ -31,13 +31,20 @@
#include <pthread.h>
#include <math.h>
-#ifdef HAVE_FFMPEG_AVUTIL_H
-# include <avcodec.h>
-#else
-# include <libavcodec/avcodec.h>
+#if defined(HAVE_LIBAVUTIL_AVUTIL_H)
+# include <libavutil/avutil.h>
+#endif
+
+#if defined(HAVE_LIBAVUTIL_MEM_H)
# include <libavutil/mem.h>
#endif
+#if defined(HAVE_AVUTIL_AVCODEC_H)
+# include <libavcodec/avcodec.h>
+#else
+# include <avcodec.h>
+#endif
+
#define LOG_MODULE "ffmpeg_audio_dec"
#define LOG_VERBOSE
/*
--- a/src/combined/ffmpeg/ffmpeg_compat.h
+++ b/src/combined/ffmpeg/ffmpeg_compat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2021 the xine project
+ * Copyright (C) 2000-2022 the xine project
*
* This file is part of xine, a unix video player.
*
@@ -25,22 +25,24 @@
#define XFF_INT_VERSION(major,minor,micro) ((major<<16)|(minor<<8)|micro)
-#ifndef LIBAVCODEC_VERSION_INT
-# if defined(LIBAVCODEC_VERSION_MAJOR) && defined(LIBAVCODEC_VERSION_MINOR)
-# define LIBAVCODEC_VERSION_INT XFF_INT_VERSION(LIBAVCODEC_VERSION_MAJOR,LIBAVCODEC_VERSION_MINOR,0)
-# else
-# error ffmpeg headers must be included first !
-# endif
+/** NOTE: since 2022-09-01, ffmpeg headers are more detached from each other.
+ * this goes that far:
+ * libavformat/avformat.h includes libavcodec/packet.h which uses
+ * (but not includes) libavutil/avutil.h :-/ */
+
+#if !defined(LIBAVUTIL_VERSION_INT) && defined(LIBAVUTIL_VERSION_MAJOR) && defined(LIBAVUTIL_VERSION_MINOR)
+# define LIBAVUTIL_VERSION_INT XFF_INT_VERSION(LIBAVUTIL_VERSION_MAJOR,LIBAVUTIL_VERSION_MINOR,0)
+#endif
+#if !defined(LIBAVUTIL_VERSION_INT)
+# error avutil.h must be included first !
#endif
-#ifndef LIBAVUTIL_VERSION_INT
-# if defined(LIBAVUTIL_VERSION_MAJOR) && defined(LIBAVUTIL_VERSION_MINOR)
-# define LIBAVUTIL_VERSION_INT XFF_INT_VERSION(LIBAVUTIL_VERSION_MAJOR,LIBAVUTIL_VERSION_MINOR,0)
-# else
-# error ffmpeg headers must be included first !
-# endif
+#if !defined(LIBAVCODEC_VERSION_INT) && defined(LIBAVCODEC_VERSION_MAJOR) && defined(LIBAVCODEC_VERSION_MINOR)
+# define LIBAVCODEC_VERSION_INT XFF_INT_VERSION(LIBAVCODEC_VERSION_MAJOR,LIBAVCODEC_VERSION_MINOR,0)
#endif
+#if defined(LIBAVCODEC_VERSION_INT)
+
#if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(52,0,0)
# define bits_per_sample bits_per_coded_sample
#endif
@@ -136,38 +138,6 @@
# define XFF_VAAPI 2 /** << libavutil/hwcontext.h, libavutil/hwcontext_vaapi.h */
#endif
-#if LIBAVUTIL_VERSION_INT >= XFF_INT_VERSION(52,0,0)
-# define PIX_FMT_NONE AV_PIX_FMT_NONE
-# define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
-# define PIX_FMT_YUVJ420P AV_PIX_FMT_YUVJ420P
-# define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P
-# define PIX_FMT_YUVJ444P AV_PIX_FMT_YUVJ444P
-# define PIX_FMT_YUV410P AV_PIX_FMT_YUV410P
-# define PIX_FMT_YUV411P AV_PIX_FMT_YUV411P
-# define PIX_FMT_ARGB AV_PIX_FMT_ARGB
-# define PIX_FMT_BGRA AV_PIX_FMT_BGRA
-# define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
-# define PIX_FMT_BGR24 AV_PIX_FMT_BGR24
-# define PIX_FMT_RGB555BE AV_PIX_FMT_RGB555BE
-# define PIX_FMT_RGB555LE AV_PIX_FMT_RGB555LE
-# define PIX_FMT_RGB565BE AV_PIX_FMT_RGB565BE
-# define PIX_FMT_RGB565LE AV_PIX_FMT_RGB565LE
-# define PIX_FMT_PAL8 AV_PIX_FMT_PAL8
-# define PixelFormat AVPixelFormat
-/* video_out/video_out_vaapi */
-# if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,0,100) /** << revise this */
-# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI_VLD
-# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI_IDCT
-# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI_MOCO
-# else
-# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI
-# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI
-# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI
-# endif
-
-# define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT
-#endif
-
#if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(54,25,0)
/* dxr3/ffmpeg_encoder */
# define CODEC_ID_MPEG1VIDEO AV_CODEC_ID_MPEG1VIDEO
@@ -194,10 +164,6 @@
/* ff_*_decoder mapping is already handled by mkcodeclists.pl */
#endif
-#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
-# define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
-#endif
-
#if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(55,0,100)
# define XFF_AV_BUFFER 1
#endif
@@ -290,5 +256,51 @@
# define XFF_AVCODEC_REGISTER_ALL() do {} while(0)
#endif
+#if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,24,100)
+# define XFF_AUDIO_CHANNEL_LAYOUT 1 /* AVCodecContext.channels, .channel_leyout */
+#else
+# define XFF_AUDIO_CHANNEL_LAYOUT 2 /* AVCodecContext.ch_layout.nb_channels, .ch_layout.u.mask */
+#endif
+
+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
+# define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
+#endif
+
+#if LIBAVUTIL_VERSION_INT >= XFF_INT_VERSION(52,0,0)
+# define PIX_FMT_NONE AV_PIX_FMT_NONE
+# define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
+# define PIX_FMT_YUVJ420P AV_PIX_FMT_YUVJ420P
+# define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P
+# define PIX_FMT_YUVJ444P AV_PIX_FMT_YUVJ444P
+# define PIX_FMT_YUV410P AV_PIX_FMT_YUV410P
+# define PIX_FMT_YUV411P AV_PIX_FMT_YUV411P
+# define PIX_FMT_ARGB AV_PIX_FMT_ARGB
+# define PIX_FMT_BGRA AV_PIX_FMT_BGRA
+# define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
+# define PIX_FMT_BGR24 AV_PIX_FMT_BGR24
+# define PIX_FMT_RGB555BE AV_PIX_FMT_RGB555BE
+# define PIX_FMT_RGB555LE AV_PIX_FMT_RGB555LE
+# define PIX_FMT_RGB565BE AV_PIX_FMT_RGB565BE
+# define PIX_FMT_RGB565LE AV_PIX_FMT_RGB565LE
+# define PIX_FMT_PAL8 AV_PIX_FMT_PAL8
+# define PixelFormat AVPixelFormat
+/* video_out/video_out_vaapi */
+# if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,0,100) /** << revise this */
+# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI_VLD
+# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI_IDCT
+# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI_MOCO
+# else
+# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI
+# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI
+# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI
+# endif
+
+# define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT
+#endif
+
+#else /* defined(LIBAVCODEC_VERSION_INT) */
+# error avcodec.h must be included first !
+#endif /* defined(LIBAVCODEC_VERSION_INT) */
+
#endif /* XINE_AVCODEC_COMPAT_H */
--- a/src/combined/ffmpeg/ffmpeg_decoder.c
+++ b/src/combined/ffmpeg/ffmpeg_decoder.c 2022-09-13 23:43:40.255615724 -0300
@@ -26,12 +26,20 @@
#include <pthread.h>
-#ifdef HAVE_FFMPEG_AVUTIL_H
-# include <avcodec.h>
-#else
-# include <libavcodec/avcodec.h>
+#if defined(HAVE_LIBAVUTIL_AVUTIL_H)
+# include <libavutil/avutil.h>
+#endif
+
+#if defined(HAVE_LIBAVUTIL_MEM_H)
# include <libavutil/mem.h>
#endif
+
+#if defined(HAVE_AVUTIL_AVCODEC_H)
+# include <libavcodec/avcodec.h>
+#else
+# include <avcodec.h>
+#endif
+
#ifdef HAVE_AVFORMAT
# include <libavformat/avformat.h> // av_register_all()
#endif
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001-2021 the xine project
+ * Copyright (C) 2001-2022 the xine project
*
* This file is part of xine, a free video player.
*
@@ -32,13 +32,20 @@
#include <math.h>
#include <assert.h>
-#ifdef HAVE_FFMPEG_AVUTIL_H
-# include <avcodec.h>
-#else
-# include <libavcodec/avcodec.h>
+#if defined(HAVE_LIBAVUTIL_AVUTIL_H)
+# include <libavutil/avutil.h>
+#endif
+
+#if defined(HAVE_LIBAVUTIL_MEM_H)
# include <libavutil/mem.h>
#endif
+#if defined(HAVE_AVUTIL_AVCODEC_H)
+# include <libavcodec/avcodec.h>
+#else
+# include <avcodec.h>
+#endif
+
#define LOG_MODULE "ffmpeg_video_dec"
#define LOG_VERBOSE
/*
--- a/src/combined/ffmpeg/input_avio.c
+++ b/src/combined/ffmpeg/input_avio.c 2022-09-13 23:43:40.255615724 -0300
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2020 the xine project
+ * Copyright (C) 2013-2022 the xine project
* Copyright (C) 2013-2020 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This file is part of xine, a free video player.
@@ -28,6 +28,8 @@
#include <string.h>
#include <pthread.h>
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
#include <libavformat/avio.h>
#define LOG_MODULE "libavio"