summaryrefslogtreecommitdiffstats
path: root/source/xap
diff options
context:
space:
mode:
Diffstat (limited to 'source/xap')
-rw-r--r--source/xap/FTBFSlog3
-rwxr-xr-xsource/xap/MPlayer/MPlayer.SlackBuild2
-rwxr-xr-xsource/xap/audacious-plugins/audacious-plugins.SlackBuild2
-rwxr-xr-xsource/xap/blackbox/blackbox.SlackBuild3
-rw-r--r--source/xap/blackbox/blackbox.ctime.diff10
-rw-r--r--source/xap/ffmpegthumbnailer/198.patch320
-rw-r--r--source/xap/ffmpegthumbnailer/efb5b618.patch22
-rwxr-xr-xsource/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild12
-rwxr-xr-xsource/xap/freerdp/freerdp.SlackBuild2
-rw-r--r--source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch237
-rwxr-xr-xsource/xap/ssr/ssr.SlackBuild4
-rw-r--r--source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch330
-rwxr-xr-xsource/xap/xine-lib/xine-lib.SlackBuild13
13 files changed, 950 insertions, 10 deletions
diff --git a/source/xap/FTBFSlog b/source/xap/FTBFSlog
index 859555ed5..8e7c7926e 100644
--- a/source/xap/FTBFSlog
+++ b/source/xap/FTBFSlog
@@ -1,3 +1,6 @@
+Sun Oct 9 20:11:17 UTC 2022
+ blackbox: Add #include <ctime>. Thanks to nobodino.
++--------------------------+
Mon Feb 7 20:57:55 UTC 2022
All packages tested and found to compile properly.
+--------------------------+
diff --git a/source/xap/MPlayer/MPlayer.SlackBuild b/source/xap/MPlayer/MPlayer.SlackBuild
index 7becb7598..718d48c97 100755
--- a/source/xap/MPlayer/MPlayer.SlackBuild
+++ b/source/xap/MPlayer/MPlayer.SlackBuild
@@ -25,7 +25,7 @@
# Set initial variables:
PKGNAM=MPlayer
-VERSION=${VERSION:-20210418}
+VERSION=${VERSION:-20221009}
# Need to build trunk until there's a stable branch compatible with the
# latest ffmpeg stable release:
#BRANCH=${BRANCH:-1.3} # leave empty if you want to build MPlayer trunk
diff --git a/source/xap/audacious-plugins/audacious-plugins.SlackBuild b/source/xap/audacious-plugins/audacious-plugins.SlackBuild
index 3e3de478b..65d939a21 100755
--- a/source/xap/audacious-plugins/audacious-plugins.SlackBuild
+++ b/source/xap/audacious-plugins/audacious-plugins.SlackBuild
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=audacious-plugins
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Whether to include faad/aac support:
FAAD=${FAAD:---disable-aac}
diff --git a/source/xap/blackbox/blackbox.SlackBuild b/source/xap/blackbox/blackbox.SlackBuild
index 8f99f5c60..5157533a0 100755
--- a/source/xap/blackbox/blackbox.SlackBuild
+++ b/source/xap/blackbox/blackbox.SlackBuild
@@ -92,6 +92,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+# Fix FTBFS:
+zcat $CWD/blackbox.ctime.diff.gz | patch -p1 --verbose || exit 1
+
autoreconf -vif
# Configure:
diff --git a/source/xap/blackbox/blackbox.ctime.diff b/source/xap/blackbox/blackbox.ctime.diff
new file mode 100644
index 000000000..0b816f2ac
--- /dev/null
+++ b/source/xap/blackbox/blackbox.ctime.diff
@@ -0,0 +1,10 @@
+--- ./src/Toolbar.cc.orig 2013-09-24 12:20:15.000000000 -0500
++++ ./src/Toolbar.cc 2022-10-09 15:10:31.085253543 -0500
+@@ -38,6 +38,7 @@
+ #include <X11/Xutil.h>
+ #include <sys/time.h>
+ #include <assert.h>
++#include <ctime>
+
+
+ long nextTimeout(int resolution)
diff --git a/source/xap/ffmpegthumbnailer/198.patch b/source/xap/ffmpegthumbnailer/198.patch
new file mode 100644
index 000000000..25a4a5f0c
--- /dev/null
+++ b/source/xap/ffmpegthumbnailer/198.patch
@@ -0,0 +1,320 @@
+From 67be4abd22b726e277c4b67bfb3abf5a65cfd9b5 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:23:23 +1000
+Subject: [PATCH 1/9] lib/moviedecoder: remove unused variable
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index 290e212..aa44adf 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -570,8 +570,6 @@ bool MovieDecoder::getVideoPacket()
+ bool framesAvailable = true;
+ bool frameDecoded = false;
+
+- int attempts = 0;
+-
+ if (m_pPacket)
+ {
+ av_packet_unref(m_pPacket);
+
+From 66f64668e7a063e790813c7733ca438ab112af89 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:42:07 +1000
+Subject: [PATCH 2/9] lib/moviedecoder: clang-tidy fixes
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index aa44adf..79c950b 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -503,12 +503,12 @@ void MovieDecoder::seek(int timeInSeconds)
+ avcodec_flush_buffers(m_pFormatContext->streams[m_VideoStream]->codec);
+
+ int keyFrameAttempts = 0;
+- bool gotFrame = 0;
++ bool gotFrame;
+
+ do
+ {
+ int count = 0;
+- gotFrame = 0;
++ gotFrame = false;
+
+ while (!gotFrame && count < 20)
+ {
+
+From 96c22aa66719846854895afcb72962862d5a4ffd Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 20:39:32 +1000
+Subject: [PATCH 3/9] lib/moviedecoder: remove SilenceLogLevel
+
+Was unused.
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index 79c950b..21df096 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -41,11 +41,6 @@ using namespace std;
+ namespace ffmpegthumbnailer
+ {
+
+-struct SilenceLogLevel
+-{
+- SilenceLogLevel() { av_log_set_level(AV_LOG_QUIET); }
+-};
+-
+ MovieDecoder::MovieDecoder(AVFormatContext* pavContext)
+ : m_VideoStream(-1)
+ , m_pFormatContext(pavContext)
+
+From 664680f4bfeb89923f485eba270f9e49a8d02bfc Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:25:40 +1000
+Subject: [PATCH 4/9] lib/moviedecoder: remove registration calls
+
+They're not needed anymore.
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index 21df096..ac3e5b9 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -65,8 +65,6 @@ MovieDecoder::~MovieDecoder()
+
+ void MovieDecoder::initialize(const string& filename, bool preferEmbeddedMetadata)
+ {
+- av_register_all();
+- avcodec_register_all();
+ avformat_network_init();
+
+ string inputFile = filename == "-" ? "pipe:" : filename;
+@@ -386,8 +384,6 @@ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std::
+ auto del = [] (AVBufferSinkParams* p) { av_freep(p); };
+ std::unique_ptr<AVBufferSinkParams, decltype(del)> buffersinkParams(av_buffersink_params_alloc(), del);
+
+- avfilter_register_all();
+-
+ m_pFilterGraph = avfilter_graph_alloc();
+ assert(m_pFilterGraph);
+
+
+From 1ae42e664e1f3c915d186ae00aa2c8018b998708 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:30:21 +1000
+Subject: [PATCH 5/9] lib/moviedecoder: remove use of AVBufferSinkParams
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index ac3e5b9..dece668 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -379,11 +379,6 @@ std::string MovieDecoder::createScaleString(const std::string& sizeString, bool
+
+ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std::string& size, bool maintainAspectRatio)
+ {
+- static const AVPixelFormat pixelFormats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE };
+-
+- auto del = [] (AVBufferSinkParams* p) { av_freep(p); };
+- std::unique_ptr<AVBufferSinkParams, decltype(del)> buffersinkParams(av_buffersink_params_alloc(), del);
+-
+ m_pFilterGraph = avfilter_graph_alloc();
+ assert(m_pFilterGraph);
+
+@@ -395,10 +390,8 @@ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std::
+
+ checkRc(avfilter_graph_create_filter(&m_pFilterSource, avfilter_get_by_name("buffer"), "thumb_buffer", ss.str().c_str(), nullptr, m_pFilterGraph),
+ "Failed to create filter source");
+- buffersinkParams->pixel_fmts = pixelFormats;
+- checkRc(avfilter_graph_create_filter(&m_pFilterSink, avfilter_get_by_name("buffersink"), "thumb_buffersink", nullptr, buffersinkParams.get(), m_pFilterGraph),
++ checkRc(avfilter_graph_create_filter(&m_pFilterSink, avfilter_get_by_name("buffersink"), "thumb_buffersink", nullptr, nullptr, m_pFilterGraph),
+ "Failed to create filter sink");
+- buffersinkParams.release();
+
+ AVFilterContext* yadifFilter = nullptr;
+ if (m_pFrame->interlaced_frame != 0)
+
+From 19675349662a4ea4455d7d13b01cca28ab585762 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:39:58 +1000
+Subject: [PATCH 6/9] lib/moviedecoder: use m_pVideoCodecContext instead of
+ AVStream::codec
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index dece668..0b7a280 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -484,7 +484,7 @@ void MovieDecoder::seek(int timeInSeconds)
+ }
+
+ checkRc(av_seek_frame(m_pFormatContext, -1, timestamp, 0), "Seeking in video failed");
+- avcodec_flush_buffers(m_pFormatContext->streams[m_VideoStream]->codec);
++ avcodec_flush_buffers(m_pVideoCodecContext);
+
+ int keyFrameAttempts = 0;
+ bool gotFrame;
+
+From 4f74f83a009fa2b3f3d546adb24d4f1406910007 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:49:03 +1000
+Subject: [PATCH 7/9] lib/moviedecoder: codec -> codecpar
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index 0b7a280..e58904e 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -145,10 +145,10 @@ int32_t MovieDecoder::findPreferedVideoStream(bool preferEmbeddedMetadata)
+ for (unsigned int i = 0; i < m_pFormatContext->nb_streams; ++i)
+ {
+ AVStream *stream = m_pFormatContext->streams[i];
+- auto ctx = m_pFormatContext->streams[i]->codec;
+- if (ctx->codec_type == AVMEDIA_TYPE_VIDEO)
++ auto par = m_pFormatContext->streams[i]->codecpar;
++ if (par->codec_type == AVMEDIA_TYPE_VIDEO)
+ {
+- if (!preferEmbeddedMetadata || !isStillImageCodec(ctx->codec_id))
++ if (!preferEmbeddedMetadata || !isStillImageCodec(par->codec_id))
+ {
+ videoStreams.push_back(i);
+ continue;
+
+From 3ffdd65cbda6ef21d36c96013db1b0f4dc9fc57b Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 17:52:01 +1000
+Subject: [PATCH 8/9] lib/movedecoder: don't rely on avformat to allocate a
+ context
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index e58904e..da5f32a 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -90,8 +90,7 @@ void MovieDecoder::destroy()
+ {
+ if (m_pVideoCodecContext)
+ {
+- avcodec_close(m_pVideoCodecContext);
+- m_pVideoCodecContext = nullptr;
++ avcodec_free_context(&m_pVideoCodecContext);
+ }
+
+ if ((!m_FormatContextWasGiven) && m_pFormatContext)
+@@ -196,8 +195,7 @@ void MovieDecoder::initializeVideo(bool preferEmbeddedMetadata)
+ }
+
+ m_pVideoStream = m_pFormatContext->streams[m_VideoStream];
+- m_pVideoCodecContext = m_pVideoStream->codec;
+- m_pVideoCodec = avcodec_find_decoder(m_pVideoCodecContext->codec_id);
++ m_pVideoCodec = avcodec_find_decoder(m_pVideoStream->codecpar->codec_id);
+
+ if (m_pVideoCodec == nullptr)
+ {
+@@ -207,6 +205,20 @@ void MovieDecoder::initializeVideo(bool preferEmbeddedMetadata)
+ throw logic_error("Video Codec not found");
+ }
+
++ m_pVideoCodecContext = avcodec_alloc_context3(m_pVideoCodec);
++
++ if (m_pVideoCodecContext == nullptr)
++ {
++ destroy();
++ throw logic_error("Could not allocate video codec context");
++ }
++
++ if (avcodec_parameters_to_context(m_pVideoCodecContext, m_pVideoStream->codecpar) < 0)
++ {
++ destroy();
++ throw logic_error("Could not configure video codec context");
++ }
++
+ m_pVideoCodecContext->workaround_bugs = 1;
+
+ if (avcodec_open2(m_pVideoCodecContext, m_pVideoCodec, nullptr) < 0)
+
+From f9273852c8e3d7af77d6c8929b1ac6c8a26eca50 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Mon, 15 Mar 2021 20:57:45 +1000
+Subject: [PATCH 9/9] lib/moviedecoder: replace avcodec_decode_video2() usage
+
+---
+ libffmpegthumbnailer/moviedecoder.cpp | 31 +++++++++++++++++++++------
+ 1 file changed, 24 insertions(+), 7 deletions(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp
+index da5f32a..f32577a 100644
+--- a/libffmpegthumbnailer/moviedecoder.cpp
++++ b/libffmpegthumbnailer/moviedecoder.cpp
+@@ -548,17 +548,33 @@ bool MovieDecoder::decodeVideoPacket()
+ return false;
+ }
+
+- av_frame_unref(m_pFrame);
+-
+- int frameFinished;
++ int rc = avcodec_send_packet(m_pVideoCodecContext, m_pPacket);
++ if(rc == AVERROR(EAGAIN))
++ {
++ rc = 0;
++ }
+
+- int bytesDecoded = avcodec_decode_video2(m_pVideoCodecContext, m_pFrame, &frameFinished, m_pPacket);
+- if (bytesDecoded < 0)
++ if(rc == AVERROR_EOF)
++ {
++ return false;
++ }
++ else if(rc < 0)
+ {
+- throw logic_error("Failed to decode video frame: bytesDecoded < 0");
++ throw logic_error("Failed to decode video frame: avcodec_send_packet() < 0");
+ }
+
+- return frameFinished > 0;
++ rc = avcodec_receive_frame(m_pVideoCodecContext, m_pFrame);
++ switch(rc)
++ {
++ case 0:
++ return true;
++
++ case AVERROR(EAGAIN):
++ return false;
++
++ default:
++ throw logic_error("Failed to decode video frame: avcodec_receive_frame() < 0");
++ }
+ }
+
+ bool MovieDecoder::getVideoPacket()
+@@ -574,6 +590,7 @@ bool MovieDecoder::getVideoPacket()
+
+ m_pPacket = new AVPacket();
+
++
+ while (framesAvailable && !frameDecoded)
+ {
+ framesAvailable = av_read_frame(m_pFormatContext, m_pPacket) >= 0;
diff --git a/source/xap/ffmpegthumbnailer/efb5b618.patch b/source/xap/ffmpegthumbnailer/efb5b618.patch
new file mode 100644
index 000000000..81e57aab1
--- /dev/null
+++ b/source/xap/ffmpegthumbnailer/efb5b618.patch
@@ -0,0 +1,22 @@
+From efb5b618f1c1471c1a7900aed3a59d851ea9a210 Mon Sep 17 00:00:00 2001
+From: Paul Jonkins <paul.ionkin@gmail.com>
+Date: Wed, 23 Jun 2021 17:53:55 +0200
+Subject: [PATCH] Constify AVCodec
+
+---
+ libffmpegthumbnailer/moviedecoder.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libffmpegthumbnailer/moviedecoder.h b/libffmpegthumbnailer/moviedecoder.h
+index 3ef5f12..fb6add2 100644
+--- a/libffmpegthumbnailer/moviedecoder.h
++++ b/libffmpegthumbnailer/moviedecoder.h
+@@ -78,7 +78,7 @@ class MovieDecoder
+ int m_VideoStream;
+ AVFormatContext* m_pFormatContext;
+ AVCodecContext* m_pVideoCodecContext;
+- AVCodec* m_pVideoCodec;
++ const AVCodec* m_pVideoCodec;
+ AVFilterGraph* m_pFilterGraph;
+ AVFilterContext* m_pFilterSource;
+ AVFilterContext* m_pFilterSink;
diff --git a/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild b/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild
index b590ee79e..bc46b59cc 100755
--- a/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild
+++ b/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=ffmpegthumbnailer
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -87,6 +87,10 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+# Fix build with ffmpeg-5:
+zcat $CWD/198.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/efb5b618.patch.gz | patch -p1 --verbose || exit 1
+
# Configure, build, and install:
mkdir cmake-build
cd cmake-build
@@ -98,10 +102,10 @@ cd cmake-build
-DCMAKE_INSTALL_MANDIR="man" \
-DENABLE_GIO="yes" \
-DENABLE_THUMBNAILER="yes" \
- ..
+ .. || exit 1
- make VERBOSE=1
- make install DESTDIR=$PKG
+ make VERBOSE=1 || exit 1
+ make install DESTDIR=$PKG || exit 1
cd ..
# Strip binaries:
diff --git a/source/xap/freerdp/freerdp.SlackBuild b/source/xap/freerdp/freerdp.SlackBuild
index 21e78ee05..6252d5db3 100755
--- a/source/xap/freerdp/freerdp.SlackBuild
+++ b/source/xap/freerdp/freerdp.SlackBuild
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=freerdp
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch b/source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch
new file mode 100644
index 000000000..1b40715d6
--- /dev/null
+++ b/source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch
@@ -0,0 +1,237 @@
+From: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= <bero@lindev.ch>
+Date: Sun, 16 Jan 2022 02:40:04 +0100
+Subject: Fix build with ffmpeg 5.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+Adapt to ffmpeg 5.0 requiring more const-ness for AVCodec.
+
+Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
+---
+ src/AV/Output/AudioEncoder.cpp | 6 +++---
+ src/AV/Output/AudioEncoder.h | 4 ++--
+ src/AV/Output/BaseEncoder.cpp | 4 ++--
+ src/AV/Output/BaseEncoder.h | 4 ++--
+ src/AV/Output/Muxer.cpp | 12 ++++++------
+ src/AV/Output/Muxer.h | 4 ++--
+ src/AV/Output/VideoEncoder.cpp | 6 +++---
+ src/AV/Output/VideoEncoder.h | 4 ++--
+ 8 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/src/AV/Output/AudioEncoder.cpp b/src/AV/Output/AudioEncoder.cpp
+index 34d015c..cefc2e0 100644
+--- a/src/AV/Output/AudioEncoder.cpp
++++ b/src/AV/Output/AudioEncoder.cpp
+@@ -34,7 +34,7 @@ const std::vector<AudioEncoder::SampleFormatData> AudioEncoder::SUPPORTED_SAMPLE
+
+ const unsigned int AudioEncoder::DEFAULT_FRAME_SAMPLES = 1024;
+
+-AudioEncoder::AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext *codec_context, AVCodec* codec, AVDictionary** options)
++AudioEncoder::AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext *codec_context, const AVCodec* codec, AVDictionary** options)
+ : BaseEncoder(muxer, stream, codec_context, codec, options) {
+
+ #if !SSR_USE_AVCODEC_ENCODE_AUDIO2
+@@ -77,7 +77,7 @@ unsigned int AudioEncoder::GetSampleRate() {
+ }
+
+ bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) {
+- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
+ if(codec == NULL)
+ return false;
+ if(!av_codec_is_encoder(codec))
+@@ -93,7 +93,7 @@ bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) {
+ return false;
+ }
+
+-void AudioEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
++void AudioEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
+ unsigned int bit_rate, unsigned int channels, unsigned int sample_rate) {
+
+ if(channels == 0) {
+diff --git a/src/AV/Output/AudioEncoder.h b/src/AV/Output/AudioEncoder.h
+index c93278c..ae9c82e 100644
+--- a/src/AV/Output/AudioEncoder.h
++++ b/src/AV/Output/AudioEncoder.h
+@@ -40,7 +40,7 @@ private:
+ #endif
+
+ public:
+- AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options);
++ AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options);
+ ~AudioEncoder();
+
+ // Returns the required frame size, i.e. the number of samples (for each channel).
+@@ -57,7 +57,7 @@ public:
+
+ public:
+ static bool AVCodecIsSupported(const QString& codec_name);
+- static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
++ static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
+ unsigned int bit_rate, unsigned int channels, unsigned int sample_rate);
+
+ private:
+diff --git a/src/AV/Output/BaseEncoder.cpp b/src/AV/Output/BaseEncoder.cpp
+index 7c01ef3..4780aaf 100644
+--- a/src/AV/Output/BaseEncoder.cpp
++++ b/src/AV/Output/BaseEncoder.cpp
+@@ -42,7 +42,7 @@ double ParseCodecOptionDouble(const QString& key, const QString& value, double m
+ return clamp(value_double, min, max) * multiply;
+ }
+
+-BaseEncoder::BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options) {
++BaseEncoder::BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options) {
+
+ m_muxer = muxer;
+ m_stream = stream;
+@@ -157,7 +157,7 @@ void BaseEncoder::IncrementPacketCounter() {
+ ++lock->m_total_packets;
+ }
+
+-void BaseEncoder::Init(AVCodec* codec, AVDictionary** options) {
++void BaseEncoder::Init(const AVCodec* codec, AVDictionary** options) {
+
+ // open codec
+ if(avcodec_open2(m_codec_context, codec, options) < 0) {
+diff --git a/src/AV/Output/BaseEncoder.h b/src/AV/Output/BaseEncoder.h
+index 3d92f29..7f02bbd 100644
+--- a/src/AV/Output/BaseEncoder.h
++++ b/src/AV/Output/BaseEncoder.h
+@@ -51,7 +51,7 @@ private:
+ std::atomic<bool> m_should_stop, m_should_finish, m_is_done, m_error_occurred;
+
+ protected:
+- BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options);
++ BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options);
+
+ public:
+ virtual ~BaseEncoder(); // encoders will be deleted by Muxer, don't delete them yourself!
+@@ -117,7 +117,7 @@ protected:
+ void IncrementPacketCounter();
+
+ private:
+- void Init(AVCodec* codec, AVDictionary** options);
++ void Init(const AVCodec* codec, AVDictionary** options);
+ void Free();
+
+ void EncoderThread();
+diff --git a/src/AV/Output/Muxer.cpp b/src/AV/Output/Muxer.cpp
+index ad58380..1094dcc 100644
+--- a/src/AV/Output/Muxer.cpp
++++ b/src/AV/Output/Muxer.cpp
+@@ -87,7 +87,7 @@ Muxer::~Muxer() {
+
+ VideoEncoder* Muxer::AddVideoEncoder(const QString& codec_name, const std::vector<std::pair<QString, QString> >& codec_options,
+ unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate) {
+- AVCodec *codec = FindCodec(codec_name);
++ const AVCodec *codec = FindCodec(codec_name);
+ AVCodecContext *codec_context = NULL;
+ AVStream *stream = AddStream(codec, &codec_context);
+ VideoEncoder *encoder;
+@@ -111,7 +111,7 @@ VideoEncoder* Muxer::AddVideoEncoder(const QString& codec_name, const std::vecto
+
+ AudioEncoder* Muxer::AddAudioEncoder(const QString& codec_name, const std::vector<std::pair<QString, QString> >& codec_options,
+ unsigned int bit_rate, unsigned int channels, unsigned int sample_rate) {
+- AVCodec *codec = FindCodec(codec_name);
++ const AVCodec *codec = FindCodec(codec_name);
+ AVCodecContext *codec_context = NULL;
+ AVStream *stream = AddStream(codec, &codec_context);
+ AudioEncoder *encoder;
+@@ -194,7 +194,7 @@ unsigned int Muxer::GetQueuedPacketCount(unsigned int stream_index) {
+ void Muxer::Init() {
+
+ // get the format we want (this is just a pointer, we don't have to free this)
+- AVOutputFormat *format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL);
++ auto format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL);
+ if(format == NULL) {
+ Logger::LogError("[Muxer::Init] " + Logger::tr("Error: Can't find chosen output format!"));
+ throw LibavException();
+@@ -261,8 +261,8 @@ void Muxer::Free() {
+ }
+ }
+
+-AVCodec* Muxer::FindCodec(const QString& codec_name) {
+- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
++const AVCodec* Muxer::FindCodec(const QString& codec_name) {
++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
+ if(codec == NULL) {
+ Logger::LogError("[Muxer::FindCodec] " + Logger::tr("Error: Can't find codec!"));
+ throw LibavException();
+@@ -270,7 +270,7 @@ AVCodec* Muxer::FindCodec(const QString& codec_name) {
+ return codec;
+ }
+
+-AVStream* Muxer::AddStream(AVCodec* codec, AVCodecContext** codec_context) {
++AVStream* Muxer::AddStream(const AVCodec* codec, AVCodecContext** codec_context) {
+ assert(!m_started);
+ assert(m_format_context->nb_streams < MUXER_MAX_STREAMS);
+
+diff --git a/src/AV/Output/Muxer.h b/src/AV/Output/Muxer.h
+index d72347d..b104bcb 100644
+--- a/src/AV/Output/Muxer.h
++++ b/src/AV/Output/Muxer.h
+@@ -114,8 +114,8 @@ private:
+ void Init();
+ void Free();
+
+- AVCodec* FindCodec(const QString& codec_name);
+- AVStream* AddStream(AVCodec* codec, AVCodecContext** codec_context);
++ const AVCodec* FindCodec(const QString& codec_name);
++ AVStream* AddStream(const AVCodec* codec, AVCodecContext** codec_context);
+
+ void MuxerThread();
+
+diff --git a/src/AV/Output/VideoEncoder.cpp b/src/AV/Output/VideoEncoder.cpp
+index 8087e8e..fc8b5d1 100644
+--- a/src/AV/Output/VideoEncoder.cpp
++++ b/src/AV/Output/VideoEncoder.cpp
+@@ -34,7 +34,7 @@ const std::vector<VideoEncoder::PixelFormatData> VideoEncoder::SUPPORTED_PIXEL_F
+ {"rgb", AV_PIX_FMT_RGB24, false},
+ };
+
+-VideoEncoder::VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options)
++VideoEncoder::VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options)
+ : BaseEncoder(muxer, stream, codec_context, codec, options) {
+
+ #if !SSR_USE_AVCODEC_ENCODE_VIDEO2
+@@ -95,7 +95,7 @@ unsigned int VideoEncoder::GetFrameRate() {
+ }
+
+ bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) {
+- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
+ if(codec == NULL)
+ return false;
+ if(!av_codec_is_encoder(codec))
+@@ -111,7 +111,7 @@ bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) {
+ return false;
+ }
+
+-void VideoEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
++void VideoEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
+ unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate) {
+
+ if(width == 0 || height == 0) {
+diff --git a/src/AV/Output/VideoEncoder.h b/src/AV/Output/VideoEncoder.h
+index cb7ca27..68d872e 100644
+--- a/src/AV/Output/VideoEncoder.h
++++ b/src/AV/Output/VideoEncoder.h
+@@ -40,7 +40,7 @@ private:
+ #endif
+
+ public:
+- VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options);
++ VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options);
+ ~VideoEncoder();
+
+ // Returns the required pixel format.
+@@ -55,7 +55,7 @@ public:
+
+ public:
+ static bool AVCodecIsSupported(const QString& codec_name);
+- static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
++ static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options,
+ unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate);
+
+ private:
diff --git a/source/xap/ssr/ssr.SlackBuild b/source/xap/ssr/ssr.SlackBuild
index 1d151b6d0..583d2a105 100755
--- a/source/xap/ssr/ssr.SlackBuild
+++ b/source/xap/ssr/ssr.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2020, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -85,6 +85,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+zcat $CWD/0003-Fix-build-with-ffmpeg-5.0.patch.gz | patch -p1 --verbose || exit 1
+
# Configure, build, and install:
mkdir cmake-build
cd cmake-build
diff --git a/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch b/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch
new file mode 100644
index 000000000..baa21b2f0
--- /dev/null
+++ b/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch
@@ -0,0 +1,330 @@
+--- 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"
diff --git a/source/xap/xine-lib/xine-lib.SlackBuild b/source/xap/xine-lib/xine-lib.SlackBuild
index 22aa68adf..8c637e783 100755
--- a/source/xap/xine-lib/xine-lib.SlackBuild
+++ b/source/xap/xine-lib/xine-lib.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2008, 2009, 2012, 2017, 2018, 2019 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2012, 2017, 2018, 2019, 2022 Patrick J. Volkerding, Sebeka, MN, USA
# Copyright 2011, 2012 Eric Hameleers, Eindhoven, NL
# Copyright 2017 Heinz Wiesinger, Amsterdam, NL
# All rights reserved.
@@ -32,7 +32,7 @@ DIRVER=1.2.12
# Version used for the Slackware package
PKGVER=1.2.12
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -90,6 +90,15 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+# Fix build with ffmpeg-5.1:
+zcat $CWD/020-xine-lib-ffmpeg-5.1-fix.patch.gz | patch -p1 --verbose || exit 1
+if ! grep -wq HAVE_AVUTIL_AVCODEC_H include/configure.h.in ; then
+ echo "#define HAVE_AVUTIL_AVCODEC_H 1" >> include/configure.h.in
+fi
+
+# Fix build with binutils 2.39:
+sed '/xine_set_flags/s/XINE_PROTECTED//' -i include/xine.h
+
XINE_BUILD=$TARGET \
./configure \
--prefix=/usr \