summaryrefslogtreecommitdiffstats
path: root/source/l
diff options
context:
space:
mode:
Diffstat (limited to 'source/l')
-rw-r--r--source/l/FTBFSlog3
-rwxr-xr-xsource/l/QtAV/QtAV.SlackBuild2
-rw-r--r--source/l/QtAV/ffmpeg5.patch947
-rwxr-xr-xsource/l/alsa-plugins/alsa-plugins.SlackBuild2
-rwxr-xr-xsource/l/clucene/clucene.SlackBuild3
-rw-r--r--source/l/clucene/clucene.ctime.diff10
-rw-r--r--source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch31
-rwxr-xr-xsource/l/ffmpeg/ffmpeg.SlackBuild16
-rwxr-xr-xsource/l/gegl/gegl.SlackBuild2
-rwxr-xr-xsource/l/gst-plugins-libav/gst-plugins-libav.SlackBuild2
-rw-r--r--source/l/harfbuzz/harfbuzz.url3
-rw-r--r--source/l/imagemagick/imagemagick.url2
-rwxr-xr-xsource/l/libvncserver/libvncserver.SlackBuild3
-rwxr-xr-xsource/l/mlt/mlt.SlackBuild2
-rw-r--r--source/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch20
-rwxr-xr-xsource/l/opencv/opencv.SlackBuild4
-rwxr-xr-xsource/l/pcre2/pcre2.SlackBuild12
-rwxr-xr-xsource/l/pipewire/fetch-media-session.sh38
-rwxr-xr-xsource/l/pipewire/pipewire.SlackBuild5
-rw-r--r--source/l/qt5/patches/qt5-webengine-ffmpeg5.patch150
-rwxr-xr-xsource/l/qt5/qt5.SlackBuild5
21 files changed, 1243 insertions, 19 deletions
diff --git a/source/l/FTBFSlog b/source/l/FTBFSlog
index 5e9e89edb..98f4a837c 100644
--- a/source/l/FTBFSlog
+++ b/source/l/FTBFSlog
@@ -1,3 +1,6 @@
+Sun Oct 9 20:08:52 UTC 2022
+ clucene: add #include <ctime>. Thanks to nobodino.
++--------------------------+
Tue Apr 12 00:21:44 UTC 2022
babl: fix to build with meson 0.62.0. Thanks to nobodino.
+--------------------------+
diff --git a/source/l/QtAV/QtAV.SlackBuild b/source/l/QtAV/QtAV.SlackBuild
index c393ee9ad..aab178574 100755
--- a/source/l/QtAV/QtAV.SlackBuild
+++ b/source/l/QtAV/QtAV.SlackBuild
@@ -86,6 +86,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+zcat $CWD/ffmpeg5.patch.gz | patch -p1 --verbose || exit 1
+
export CFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"
export LDFLAGS="$SLKLDFLAGS"
diff --git a/source/l/QtAV/ffmpeg5.patch b/source/l/QtAV/ffmpeg5.patch
new file mode 100644
index 000000000..53e60b8ff
--- /dev/null
+++ b/source/l/QtAV/ffmpeg5.patch
@@ -0,0 +1,947 @@
+diff --git a/src/AVCompat.cpp b/src/AVCompat.cpp
+index befb3cd9..cf113f03 100644
+--- a/src/AVCompat.cpp
++++ b/src/AVCompat.cpp
+@@ -391,7 +391,7 @@ const char *get_codec_long_name(enum AVCodecID id)
+ if (cd)
+ return cd->long_name;
+ av_log(NULL, AV_LOG_WARNING, "Codec 0x%x is not in the full list.\n", id);
+- AVCodec *codec = avcodec_find_decoder(id);
++ const AVCodec *codec = avcodec_find_decoder(id);
+ if (codec)
+ return codec->long_name;
+ codec = avcodec_find_encoder(id);
+diff --git a/src/AVDemuxer.cpp b/src/AVDemuxer.cpp
+index 432c4f04..5b46afd3 100644
+--- a/src/AVDemuxer.cpp
++++ b/src/AVDemuxer.cpp
+@@ -290,7 +290,7 @@ public:
+ //copy the info, not parse the file when constructed, then need member vars
+ QString file;
+ QString file_orig;
+- AVInputFormat *input_format;
++ const AVInputFormat *input_format;
+ QString format_forced;
+ MediaIO *input;
+
+@@ -310,7 +310,11 @@ public:
+ // wanted_stream is REQUIRED. e.g. always set -1 to indicate the default stream, -2 to disable
+ int stream, wanted_stream; // -1 default, selected by ff
+ int index, wanted_index; // index in a kind of streams
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx;
++#else
++ AVCodecParameters *avctx;
++#endif
+ } StreamInfo;
+ StreamInfo astream, vstream, sstream;
+
+@@ -614,12 +618,14 @@ bool AVDemuxer::seek(qint64 pos)
+ if (upos <= startTime()) {
+ qDebug("************seek to beginning. started = false");
+ d->started = false; //???
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ if (d->astream.avctx)
+ d->astream.avctx->frame_number = 0;
+ if (d->vstream.avctx)
+ d->vstream.avctx->frame_number = 0; //TODO: why frame_number not changed after seek?
+ if (d->sstream.avctx)
+ d->sstream.avctx->frame_number = 0;
++#endif
+ }
+ return true;
+ }
+@@ -1062,37 +1068,61 @@ QList<int> AVDemuxer::subtitleStreams() const
+ return d->subtitle_streams;
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext* AVDemuxer::audioCodecContext(int stream) const
++#else
++AVCodecParameters* AVDemuxer::audioCodecContext(int stream) const
++#endif
+ {
+ if (stream < 0)
+ return d->astream.avctx;
+ if (stream > (int)d->format_ctx->nb_streams)
+ return 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = d->format_ctx->streams[stream]->codec;
++#else
++ AVCodecParameters *avctx = d->format_ctx->streams[stream]->codecpar;
++#endif
+ if (avctx->codec_type == AVMEDIA_TYPE_AUDIO)
+ return avctx;
+ return 0;
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext* AVDemuxer::videoCodecContext(int stream) const
++#else
++AVCodecParameters* AVDemuxer::videoCodecContext(int stream) const
++#endif
+ {
+ if (stream < 0)
+ return d->vstream.avctx;
+ if (stream > (int)d->format_ctx->nb_streams)
+ return 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = d->format_ctx->streams[stream]->codec;
++#else
++ AVCodecParameters *avctx = d->format_ctx->streams[stream]->codecpar;
++#endif
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO)
+ return avctx;
+ return 0;
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext* AVDemuxer::subtitleCodecContext(int stream) const
++#else
++AVCodecParameters* AVDemuxer::subtitleCodecContext(int stream) const
++#endif
+ {
+ if (stream < 0)
+ return d->sstream.avctx;
+ if (stream > (int)d->format_ctx->nb_streams)
+ return 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = d->format_ctx->streams[stream]->codec;
++#else
++ AVCodecParameters *avctx = d->format_ctx->streams[stream]->codecpar;
++#endif
+ if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE)
+ return avctx;
+ return 0;
+@@ -1289,7 +1319,11 @@ bool AVDemuxer::Private::setStream(AVDemuxer::StreamType st, int streamValue)
+ // don't touch wanted index
+ si->stream = s;
+ si->wanted_stream = streamValue;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ si->avctx = format_ctx->streams[s]->codec;
++#else
++ si->avctx = format_ctx->streams[s]->codecpar;
++#endif
+ has_attached_pic = !!(format_ctx->streams[s]->disposition & AV_DISPOSITION_ATTACHED_PIC);
+ return true;
+ }
+@@ -1302,7 +1336,11 @@ bool AVDemuxer::Private::prepareStreams()
+ return false;
+ AVMediaType type = AVMEDIA_TYPE_UNKNOWN;
+ for (unsigned int i = 0; i < format_ctx->nb_streams; ++i) {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ type = format_ctx->streams[i]->codec->codec_type;
++#else
++ type = format_ctx->streams[i]->codecpar->codec_type;
++#endif
+ if (type == AVMEDIA_TYPE_VIDEO) {
+ video_streams.push_back(i);
+ } else if (type == AVMEDIA_TYPE_AUDIO) {
+diff --git a/src/AVMuxer.cpp b/src/AVMuxer.cpp
+index b601afd8..4ff1463e 100644
+--- a/src/AVMuxer.cpp
++++ b/src/AVMuxer.cpp
+@@ -81,7 +81,7 @@ public:
+ //copy the info, not parse the file when constructed, then need member vars
+ QString file;
+ QString file_orig;
+- AVOutputFormat *format;
++ const AVOutputFormat *format;
+ QString format_forced;
+ MediaIO *io;
+
+@@ -94,7 +94,7 @@ public:
+
+ AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codecName, AVCodecID codecId)
+ {
+- AVCodec *codec = NULL;
++ const AVCodec *codec = NULL;
+ if (!codecName.isEmpty()) {
+ codec = avcodec_find_encoder_by_name(codecName.toUtf8().constData());
+ if (!codec) {
+@@ -120,7 +120,8 @@ AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codec
+ // set by avformat if unset
+ s->id = ctx->nb_streams - 1;
+ s->time_base = kTB;
+- AVCodecContext *c = s->codec;
++#if LIBAVCODEC_VERSION_MAJOR < 59
++ AVCodec *c = s->codec;
+ c->codec_id = codec->id;
+ // Using codec->time_base is deprecated, but needed for older lavf.
+ c->time_base = s->time_base;
+@@ -129,6 +130,7 @@ AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codec
+ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+ // expose avctx to encoder and set properties in encoder?
+ // list codecs for a given format in ui
++#endif
+ return s;
+ }
+
+@@ -137,16 +139,24 @@ bool AVMuxer::Private::prepareStreams()
+ audio_streams.clear();
+ video_streams.clear();
+ subtitle_streams.clear();
+- AVOutputFormat* fmt = format_ctx->oformat;
++ const AVOutputFormat* fmt = format_ctx->oformat;
+ if (venc) {
+ AVStream *s = addStream(format_ctx, venc->codecName(), fmt->video_codec);
+ if (s) {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *c = s->codec;
++#else
++ AVCodecParameters *c = s->codecpar;
++#endif
+ c->bit_rate = venc->bitRate();
+ c->width = venc->width();
+ c->height = venc->height();
+ /// MUST set after encoder is open to ensure format is valid and the same
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ c->pix_fmt = (AVPixelFormat)VideoFormat::pixelFormatToFFmpeg(venc->pixelFormat());
++#else
++ c->format = (AVPixelFormat)VideoFormat::pixelFormatToFFmpeg(venc->pixelFormat());
++#endif
+
+ // Set avg_frame_rate based on encoder frame_rate
+ s->avg_frame_rate = av_d2q(venc->frameRate(), venc->frameRate()*1001.0+2);
+@@ -157,11 +167,19 @@ bool AVMuxer::Private::prepareStreams()
+ if (aenc) {
+ AVStream *s = addStream(format_ctx, aenc->codecName(), fmt->audio_codec);
+ if (s) {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *c = s->codec;
++#else
++ AVCodecParameters *c = s->codecpar;
++#endif
+ c->bit_rate = aenc->bitRate();
+ /// MUST set after encoder is open to ensure format is valid and the same
+ c->sample_rate = aenc->audioFormat().sampleRate();
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ c->sample_fmt = (AVSampleFormat)aenc->audioFormat().sampleFormatFFmpeg();
++#else
++ c->format = (AVSampleFormat)aenc->audioFormat().sampleFormatFFmpeg();
++#endif
+ c->channel_layout = aenc->audioFormat().channelLayoutFFmpeg();
+ c->channels = aenc->audioFormat().channels();
+ c->bits_per_raw_sample = aenc->audioFormat().bytesPerSample()*8; // need??
+diff --git a/src/AVPlayerPrivate.cpp b/src/AVPlayerPrivate.cpp
+index 84f079ef..d3bf09f1 100644
+--- a/src/AVPlayerPrivate.cpp
++++ b/src/AVPlayerPrivate.cpp
+@@ -55,7 +55,11 @@ int computeNotifyPrecision(qint64 duration, qreal fps)
+ }
+ } // namespace Internal
+
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ static bool correct_audio_channels(AVCodecContext *ctx) {
++#else
++static bool correct_audio_channels(AVCodecParameters *ctx) {
++#endif
+ if (ctx->channels <= 0) {
+ if (ctx->channel_layout) {
+ ctx->channels = av_get_channel_layout_nb_channels(ctx->channel_layout);
+@@ -251,7 +255,11 @@ void AVPlayer::Private::initBaseStatistics()
+ updateNotifyInterval();
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ void AVPlayer::Private::initCommonStatistics(int s, Statistics::Common *st, AVCodecContext *avctx)
++#else
++void AVPlayer::Private::initCommonStatistics(int s, Statistics::Common *st, AVCodecParameters *avctx)
++#endif
+ {
+ AVFormatContext *fmt_ctx = demuxer.formatContext();
+ if (!fmt_ctx) {
+@@ -288,7 +296,11 @@ void AVPlayer::Private::initCommonStatistics(int s, Statistics::Common *st, AVCo
+
+ void AVPlayer::Private::initAudioStatistics(int s)
+ {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = demuxer.audioCodecContext();
++#else
++ AVCodecParameters *avctx = demuxer.audioCodecContext();
++#endif
+ statistics.audio = Statistics::Common();
+ statistics.audio_only = Statistics::AudioOnly();
+ if (!avctx)
+@@ -306,14 +318,22 @@ void AVPlayer::Private::initAudioStatistics(int s)
+ // nb_channels -1: will use av_get_channel_layout_nb_channels
+ av_get_channel_layout_string(cl, sizeof(cl), avctx->channels, avctx->channel_layout);
+ statistics.audio_only.channel_layout = QLatin1String(cl);
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ statistics.audio_only.sample_fmt = QLatin1String(av_get_sample_fmt_name(avctx->sample_fmt));
++#else
++ statistics.audio_only.sample_fmt = QLatin1String(av_get_sample_fmt_name(static_cast<AVSampleFormat>(avctx->format)));
++#endif
+ statistics.audio_only.frame_size = avctx->frame_size;
+ statistics.audio_only.sample_rate = avctx->sample_rate;
+ }
+
+ void AVPlayer::Private::initVideoStatistics(int s)
+ {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = demuxer.videoCodecContext();
++#else
++ AVCodecParameters *avctx = demuxer.videoCodecContext();
++#endif
+ statistics.video = Statistics::Common();
+ statistics.video_only = Statistics::VideoOnly();
+ if (!avctx)
+@@ -324,10 +344,20 @@ void AVPlayer::Private::initVideoStatistics(int s)
+ statistics.video.decoder = vdec->name();
+ statistics.video.decoder_detail = vdec->description();
+ }
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ statistics.video_only.coded_height = avctx->coded_height;
+ statistics.video_only.coded_width = avctx->coded_width;
+ statistics.video_only.gop_size = avctx->gop_size;
+ statistics.video_only.pix_fmt = QLatin1String(av_get_pix_fmt_name(avctx->pix_fmt));
++#else
++ // FIXME we can't really get coded_height, coded_width and gop_size from Parameters
++ // At some point we should make an effort to get the real codec context; in the mean
++ // time, this should be close enough...
++ statistics.video_only.coded_height = avctx->height;
++ statistics.video_only.coded_width = avctx->width;
++ statistics.video_only.gop_size = 0;
++ statistics.video_only.pix_fmt = QLatin1String(av_get_pix_fmt_name(static_cast<AVPixelFormat>(avctx->format)));
++#endif
+ statistics.video_only.height = avctx->height;
+ statistics.video_only.width = avctx->width;
+ statistics.video_only.rotate = 0;
+@@ -354,7 +384,11 @@ bool AVPlayer::Private::setupAudioThread(AVPlayer *player)
+ athread->setDecoder(0);
+ athread->setOutput(0);
+ }
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = ademuxer->audioCodecContext();
++#else
++ AVCodecParameters *avctx = ademuxer->audioCodecContext();
++#endif
+ if (!avctx) {
+ // TODO: close ao? //TODO: check pulseaudio perapp control if closed
+ return false;
+@@ -384,7 +418,11 @@ bool AVPlayer::Private::setupAudioThread(AVPlayer *player)
+ correct_audio_channels(avctx);
+ AudioFormat af;
+ af.setSampleRate(avctx->sample_rate);
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ af.setSampleFormatFFmpeg(avctx->sample_fmt);
++#else
++ af.setSampleFormatFFmpeg(avctx->format);
++#endif
+ af.setChannelLayoutFFmpeg(avctx->channel_layout);
+ if (!af.isValid()) {
+ qWarning("invalid audio format. audio stream will be disabled");
+@@ -466,7 +504,11 @@ QVariantList AVPlayer::Private::getTracksInfo(AVDemuxer *demuxer, AVDemuxer::Str
+ t[QStringLiteral("stream_index")] = QVariant(s);
+
+ AVStream *stream = demuxer->formatContext()->streams[s];
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *ctx = stream->codec;
++#else
++ AVCodecParameters *ctx = stream->codecpar;
++#endif
+ if (ctx) {
+ t[QStringLiteral("codec")] = QByteArray(avcodec_descriptor_get(ctx->codec_id)->name);
+ if (ctx->extradata)
+@@ -494,7 +536,11 @@ bool AVPlayer::Private::applySubtitleStream(int n, AVPlayer *player)
+ {
+ if (!demuxer.setStreamIndex(AVDemuxer::SubtitleStream, n))
+ return false;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *ctx = demuxer.subtitleCodecContext();
++#else
++ AVCodecParameters *ctx = demuxer.subtitleCodecContext();
++#endif
+ if (!ctx)
+ return false;
+ // FIXME: AVCodecDescriptor.name and AVCodec.name are different!
+@@ -512,7 +558,11 @@ bool AVPlayer::Private::tryApplyDecoderPriority(AVPlayer *player)
+ // TODO: add an option to apply the new decoder even if not available
+ qint64 pos = player->position();
+ VideoDecoder *vd = NULL;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = demuxer.videoCodecContext();
++#else
++ AVCodecParameters *avctx = demuxer.videoCodecContext();
++#endif
+ foreach(VideoDecoderId vid, vc_ids) {
+ qDebug("**********trying video decoder: %s...", VideoDecoder::name(vid));
+ vd = VideoDecoder::create(vid);
+@@ -560,7 +610,11 @@ bool AVPlayer::Private::setupVideoThread(AVPlayer *player)
+ vthread->packetQueue()->clear();
+ vthread->setDecoder(0);
+ }
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *avctx = demuxer.videoCodecContext();
++#else
++ AVCodecParameters *avctx = demuxer.videoCodecContext();
++#endif
+ if (!avctx) {
+ return false;
+ }
+diff --git a/src/AVPlayerPrivate.h b/src/AVPlayerPrivate.h
+index e404b9bf..f0f90fd1 100644
+--- a/src/AVPlayerPrivate.h
++++ b/src/AVPlayerPrivate.h
+@@ -29,6 +29,10 @@
+ #include "AVDemuxThread.h"
+ #include "utils/Logger.h"
+
++extern "C" {
++#include <libavcodec/avcodec.h>
++}
++
+ namespace QtAV {
+
+ static const qint64 kInvalidPosition = std::numeric_limits<qint64>::max();
+@@ -43,7 +47,11 @@ public:
+ void applyFrameRate();
+ void initStatistics();
+ void initBaseStatistics();
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ void initCommonStatistics(int s, Statistics::Common* st, AVCodecContext* avctx);
++#else
++ void initCommonStatistics(int s, Statistics::Common* st, AVCodecParameters* avctx);
++#endif
+ void initAudioStatistics(int s);
+ void initVideoStatistics(int s);
+ void initSubtitleStatistics(int s);
+diff --git a/src/QtAV/AVDemuxer.h b/src/QtAV/AVDemuxer.h
+index 3b720f5d..688c82f9 100644
+--- a/src/QtAV/AVDemuxer.h
++++ b/src/QtAV/AVDemuxer.h
+@@ -28,6 +28,10 @@
+ #include <QtCore/QObject>
+ #include <QtCore/QScopedPointer>
+
++extern "C" {
++#include <libavcodec/avcodec.h>
++}
++
+ struct AVFormatContext;
+ struct AVCodecContext;
+ QT_BEGIN_NAMESPACE
+@@ -151,9 +155,15 @@ public:
+ int subtitleStream() const;
+ QList<int> subtitleStreams() const;
+ //codec. stream < 0: the stream going to play (or the stream set by setStreamIndex())
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext* audioCodecContext(int stream = -1) const;
+ AVCodecContext* videoCodecContext(int stream = -1) const;
+ AVCodecContext* subtitleCodecContext(int stream = -1) const;
++#else
++ AVCodecParameters* audioCodecContext(int stream = -1) const;
++ AVCodecParameters* videoCodecContext(int stream = -1) const;
++ AVCodecParameters* subtitleCodecContext(int stream = -1) const;
++#endif
+ /**
+ * @brief getInterruptTimeout return the interrupt timeout
+ */
+diff --git a/src/QtAV/private/AVDecoder_p.h b/src/QtAV/private/AVDecoder_p.h
+index 2382974e..5e952ea8 100644
+--- a/src/QtAV/private/AVDecoder_p.h
++++ b/src/QtAV/private/AVDecoder_p.h
+@@ -78,7 +78,7 @@ class Q_AV_PRIVATE_EXPORT AVDecoderPrivate : public DPtrPrivate<AVDecoder>
+ {
+ public:
+ static const char* getProfileName(AVCodecID id, int profile) {
+- AVCodec *c = avcodec_find_decoder(id);
++ const AVCodec *c = avcodec_find_decoder(id);
+ if (!c)
+ return "Unknow";
+ return av_get_profile_name(c, profile);
+diff --git a/src/VideoFormat.cpp b/src/VideoFormat.cpp
+index b9c7b4f0..5e7901f1 100644
+--- a/src/VideoFormat.cpp
++++ b/src/VideoFormat.cpp
+@@ -702,7 +702,11 @@ bool VideoFormat::hasPalette() const
+
+ bool VideoFormat::isPseudoPaletted() const
+ {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ return (d->flags() & AV_PIX_FMT_FLAG_PSEUDOPAL) == AV_PIX_FMT_FLAG_PSEUDOPAL;
++#else
++ return hasPalette();
++#endif
+ }
+
+ bool VideoFormat::isBitStream() const
+diff --git a/src/VideoFrameExtractor.cpp b/src/VideoFrameExtractor.cpp
+index 8e4a843e..ecaa079e 100644
+--- a/src/VideoFrameExtractor.cpp
++++ b/src/VideoFrameExtractor.cpp
+@@ -192,7 +192,11 @@ public:
+ if (!vd)
+ continue;
+ decoder.reset(vd);
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *cctx = demuxer.videoCodecContext();
++#else
++ AVCodecParameters *cctx = demuxer.videoCodecContext();
++#endif
+ if (cctx) decoder->setCodecContext(demuxer.videoCodecContext());
+ if (!cctx || !decoder->open()) {
+ decoder.reset(0);
+diff --git a/src/codec/AVDecoder.cpp b/src/codec/AVDecoder.cpp
+index 440504d0..bc9cc278 100644
+--- a/src/codec/AVDecoder.cpp
++++ b/src/codec/AVDecoder.cpp
+@@ -27,7 +27,7 @@
+
+ namespace QtAV {
+
+-static AVCodec* get_codec(const QString &name, const QString& hwa, AVCodecID cid)
++static const AVCodec* get_codec(const QString &name, const QString& hwa, AVCodecID cid)
+ {
+ QString fullname(name);
+ if (name.isEmpty()) {
+@@ -35,7 +35,7 @@ static AVCodec* get_codec(const QString &name, const QString& hwa, AVCodecID cid
+ return avcodec_find_decoder(cid);
+ fullname = QString("%1_%2").arg(avcodec_get_name(cid)).arg(hwa);
+ }
+- AVCodec *codec = avcodec_find_decoder_by_name(fullname.toUtf8().constData());
++ const AVCodec *codec = avcodec_find_decoder_by_name(fullname.toUtf8().constData());
+ if (codec)
+ return codec;
+ const AVCodecDescriptor* cd = avcodec_descriptor_get_by_name(fullname.toUtf8().constData());
+@@ -76,7 +76,7 @@ bool AVDecoder::open()
+ return false;
+ }
+ const QString hwa = property("hwaccel").toString();
+- AVCodec* codec = get_codec(codecName(), hwa, d.codec_ctx->codec_id);
++ const AVCodec* codec = get_codec(codecName(), hwa, d.codec_ctx->codec_id);
+ if (!codec) { // TODO: can be null for none-ffmpeg based decoders
+ QString es(tr("No codec could be found for '%1'"));
+ if (d.codec_name.isEmpty()) {
+@@ -153,6 +153,8 @@ void AVDecoder::flush()
+ avcodec_flush_buffers(d_func().codec_ctx);
+ }
+
++static QMap<AVCodecParameters*,AVCodecContext*> ccs;
++
+ /*
+ * do nothing if equal
+ * close the old one. the codec context can not be shared in more than 1 decoder.
+@@ -160,9 +162,17 @@ void AVDecoder::flush()
+ void AVDecoder::setCodecContext(void *codecCtx)
+ {
+ DPTR_D(AVDecoder);
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AVCodecContext *ctx = (AVCodecContext*)codecCtx;
+- if (d.codec_ctx == ctx)
++ if (d.codec_ctx == codecCtx)
+ return;
++#else
++ AVCodecParameters *ctx = (AVCodecParameters*)codecCtx;
++ if(ccs.contains(ctx)) {
++ d.codec_ctx = ccs.value(ctx);
++ return;
++ }
++#endif
+ if (isOpen()) {
+ qWarning("Can not copy codec properties when it's open");
+ close(); //
+@@ -180,7 +190,12 @@ void AVDecoder::setCodecContext(void *codecCtx)
+ qWarning("avcodec_alloc_context3 failed");
+ return;
+ }
++ ccs.insert(ctx, d.codec_ctx);
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AV_ENSURE_OK(avcodec_copy_context(d.codec_ctx, ctx));
++#else
++ AV_ENSURE_OK(avcodec_parameters_to_context(d.codec_ctx, ctx));
++#endif
+ }
+
+ //TODO: reset other parameters?
+diff --git a/src/codec/AVEncoder.cpp b/src/codec/AVEncoder.cpp
+index 455539c7..5be64db2 100644
+--- a/src/codec/AVEncoder.cpp
++++ b/src/codec/AVEncoder.cpp
+@@ -146,7 +146,13 @@ void AVEncoder::copyAVCodecContext(void* ctx)
+ AVCodecContext* c = static_cast<AVCodecContext*>(ctx);
+ if (d.avctx) {
+ // dest should be avcodec_alloc_context3(NULL)
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ AV_ENSURE_OK(avcodec_copy_context(d.avctx, c));
++#else
++ AVCodecParameters *par;
++ avcodec_parameters_from_context(par, c);
++ AV_ENSURE_OK(avcodec_parameters_to_context(d.avctx, par));
++#endif
+ d.is_open = false;
+ return;
+ }
+diff --git a/src/codec/audio/AudioDecoderFFmpeg.cpp b/src/codec/audio/AudioDecoderFFmpeg.cpp
+index d783588a..7c5188fc 100644
+--- a/src/codec/audio/AudioDecoderFFmpeg.cpp
++++ b/src/codec/audio/AudioDecoderFFmpeg.cpp
+@@ -100,10 +100,34 @@ bool AudioDecoderFFmpeg::decode(const Packet &packet)
+ av_init_packet(&eofpkt);
+ eofpkt.data = NULL;
+ eofpkt.size = 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ ret = avcodec_decode_audio4(d.codec_ctx, d.frame, &got_frame_ptr, &eofpkt);
++#else
++ ret = avcodec_receive_frame(d.codec_ctx, d.frame);
++ if (ret == AVERROR(EAGAIN))
++ return false;
++ else if (ret < 0) {
++ qWarning("[AudioDecoder] %s", av_err2str(ret));
++ return false;
++ }
++ got_frame_ptr = (ret == 0);
++ ret = avcodec_send_packet(d.codec_ctx, &eofpkt);
++#endif
+ } else {
+ // const AVPacket*: ffmpeg >= 1.0. no libav
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ ret = avcodec_decode_audio4(d.codec_ctx, d.frame, &got_frame_ptr, (AVPacket*)packet.asAVPacket());
++#else
++ ret = avcodec_receive_frame(d.codec_ctx, d.frame);
++ if (ret == AVERROR(EAGAIN))
++ return false;
++ else if (ret < 0) {
++ qWarning("[AudioDecoder] %s", av_err2str(ret));
++ return false;
++ }
++ got_frame_ptr = (ret == 0);
++ ret = avcodec_send_packet(d.codec_ctx, (AVPacket*)packet.asAVPacket());
++#endif
+ }
+ d.undecoded_size = qMin(packet.data.size() - ret, packet.data.size());
+ if (ret == AVERROR(EAGAIN)) {
+@@ -145,7 +169,11 @@ AudioFrame AudioDecoderFFmpeg::frame()
+ f.setBytesPerLine(d.frame->linesize[0], 0); // for correct alignment
+ f.setSamplesPerChannel(d.frame->nb_samples);
+ // TODO: ffplay check AVFrame.pts, pkt_pts, last_pts+nb_samples. move to AudioFrame::from(AVFrame*)
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ f.setTimestamp((double)d.frame->pkt_pts/1000.0);
++#else
++ f.setTimestamp((double)d.frame->pts/1000.0);
++#endif
+ f.setAudioResampler(d.resampler); // TODO: remove. it's not safe if frame is shared. use a pool or detach if ref >1
+ return f;
+ }
+diff --git a/src/codec/audio/AudioEncoderFFmpeg.cpp b/src/codec/audio/AudioEncoderFFmpeg.cpp
+index 3811e11a..c338aae3 100644
+--- a/src/codec/audio/AudioEncoderFFmpeg.cpp
++++ b/src/codec/audio/AudioEncoderFFmpeg.cpp
+@@ -54,7 +54,9 @@ public:
+ AudioEncoderFFmpegPrivate()
+ : AudioEncoderPrivate()
+ {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ avcodec_register_all();
++#endif
+ // NULL: codec-specific defaults won't be initialized, which may result in suboptimal default settings (this is important mainly for encoders, e.g. libx264).
+ avctx = avcodec_alloc_context3(NULL);
+ }
+@@ -68,11 +70,11 @@ bool AudioEncoderFFmpegPrivate::open()
+ {
+ if (codec_name.isEmpty()) {
+ // copy ctx from muxer by copyAVCodecContext
+- AVCodec *codec = avcodec_find_encoder(avctx->codec_id);
++ const AVCodec *codec = avcodec_find_encoder(avctx->codec_id);
+ AV_ENSURE_OK(avcodec_open2(avctx, codec, &dict), false);
+ return true;
+ }
+- 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) {
+ const AVCodecDescriptor* cd = avcodec_descriptor_get_by_name(codec_name.toUtf8().constData());
+ if (cd) {
+@@ -204,7 +206,13 @@ bool AudioEncoderFFmpeg::encode(const AudioFrame &frame)
+ pkt.data = (uint8_t*)d.buffer.constData(); //NULL
+ pkt.size = d.buffer.size(); //0
+ int got_packet = 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ int ret = avcodec_encode_audio2(d.avctx, &pkt, f, &got_packet);
++#else
++ int ret = avcodec_send_frame(d.avctx, f);
++ got_packet = (ret == 0);
++ ret = avcodec_receive_packet(d.avctx, &pkt);
++#endif
+ av_frame_free(&f);
+ if (ret < 0) {
+ //qWarning("error avcodec_encode_audio2: %s" ,av_err2str(ret));
+diff --git a/src/codec/video/VideoDecoderCUDA.cpp b/src/codec/video/VideoDecoderCUDA.cpp
+index 844a3ae6..8015b4f9 100644
+--- a/src/codec/video/VideoDecoderCUDA.cpp
++++ b/src/codec/video/VideoDecoderCUDA.cpp
+@@ -46,6 +46,10 @@
+ #include "utils/Logger.h"
+ #include "SurfaceInteropCUDA.h"
+
++extern "C" {
++#include <libavcodec/bsf.h>
++}
++
+ //decode error if not floating context
+
+ namespace QtAV {
+@@ -184,7 +188,7 @@ public:
+ }
+ ~VideoDecoderCUDAPrivate() {
+ if (bsf)
+- av_bitstream_filter_close(bsf);
++ av_bsf_free(&bsf);
+ if (!can_load)
+ return;
+ if (!isLoaded()) //cuda_api
+@@ -320,7 +324,7 @@ public:
+ int nb_dec_surface;
+ QString description;
+
+- AVBitStreamFilterContext *bsf; //TODO: rename bsf_ctx
++ AVBSFContext *bsf; //TODO: rename bsf_ctx
+
+ VideoDecoderCUDA::CopyMode copy_mode;
+ cuda::InteropResourcePtr interop_res; //may be still used in video frames when decoder is destroyed
+@@ -391,9 +395,7 @@ bool VideoDecoderCUDA::decode(const Packet &packet)
+ if (d.bsf) {
+ // h264_mp4toannexb_filter does not use last parameter 'keyFrame', so just set 0
+ //return: 0: not changed, no outBuf allocated. >0: ok. <0: fail
+- filtered = av_bitstream_filter_filter(d.bsf, d.codec_ctx, NULL, &outBuf, &outBufSize
+- , (const uint8_t*)packet.data.constData(), packet.data.size()
+- , 0);//d.is_keyframe);
++ filtered = av_bsf_receive_packet(d.bsf, (AVPacket*)packet.asAVPacket());//d.is_keyframe);
+ //qDebug("%s @%d filtered=%d outBuf=%p, outBufSize=%d", __FUNCTION__, __LINE__, filtered, outBuf, outBufSize);
+ if (filtered < 0) {
+ qDebug("failed to filter: %s", av_err2str(filtered));
+@@ -780,15 +782,17 @@ void VideoDecoderCUDAPrivate::setBSF(AVCodecID codec)
+ {
+ if (codec == QTAV_CODEC_ID(H264)) {
+ if (!bsf)
+- bsf = av_bitstream_filter_init("h264_mp4toannexb");
++ av_bsf_alloc(av_bsf_get_by_name("h264_mp4toannexb"), &bsf);
++ av_bsf_init(bsf);
+ Q_ASSERT(bsf && "h264_mp4toannexb bsf not found");
+ } else if (codec == QTAV_CODEC_ID(HEVC)) {
+ if (!bsf)
+- bsf = av_bitstream_filter_init("hevc_mp4toannexb");
++ av_bsf_alloc(av_bsf_get_by_name("hevc_mp4toannexb"), &bsf);
++ av_bsf_init(bsf);
+ Q_ASSERT(bsf && "hevc_mp4toannexb bsf not found");
+ } else {
+ if (bsf) {
+- av_bitstream_filter_close(bsf);
++ av_bsf_free(&bsf);
+ bsf = 0;
+ }
+ }
+diff --git a/src/codec/video/VideoDecoderFFmpegBase.cpp b/src/codec/video/VideoDecoderFFmpegBase.cpp
+index e344c5cb..49cebb94 100644
+--- a/src/codec/video/VideoDecoderFFmpegBase.cpp
++++ b/src/codec/video/VideoDecoderFFmpegBase.cpp
+@@ -30,12 +30,21 @@ extern ColorRange colorRangeFromFFmpeg(AVColorRange cr);
+
+ static void SetColorDetailsByFFmpeg(VideoFrame *f, AVFrame* frame, AVCodecContext* codec_ctx)
+ {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ ColorSpace cs = colorSpaceFromFFmpeg(av_frame_get_colorspace(frame));
+ if (cs == ColorSpace_Unknown)
++#else
++ ColorSpace
++#endif
+ cs = colorSpaceFromFFmpeg(codec_ctx->colorspace);
+ f->setColorSpace(cs);
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ ColorRange cr = colorRangeFromFFmpeg(av_frame_get_color_range(frame));
+ if (cr == ColorRange_Unknown) {
++#else
++ ColorRange cr;
++ if (1) {
++#endif
+ // check yuvj format. TODO: deprecated, check only for old ffmpeg?
+ const AVPixelFormat pixfmt = (AVPixelFormat)frame->format;
+ switch (pixfmt) {
+@@ -125,9 +134,21 @@ bool VideoDecoderFFmpegBase::decode(const Packet &packet)
+ av_init_packet(&eofpkt);
+ eofpkt.data = NULL;
+ eofpkt.size = 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ ret = avcodec_decode_video2(d.codec_ctx, d.frame, &got_frame_ptr, &eofpkt);
++#else
++ ret = avcodec_receive_frame(d.codec_ctx, d.frame);
++ got_frame_ptr = (ret == 0);
++ ret = avcodec_send_packet(d.codec_ctx, &eofpkt);
++#endif
+ } else {
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ ret = avcodec_decode_video2(d.codec_ctx, d.frame, &got_frame_ptr, (AVPacket*)packet.asAVPacket());
++#else
++ ret = avcodec_receive_frame(d.codec_ctx, d.frame);
++ got_frame_ptr = (ret == 0);
++ ret = avcodec_send_packet(d.codec_ctx, (AVPacket*)packet.asAVPacket());
++#endif
+ }
+ //qDebug("pic_type=%c", av_get_picture_type_char(d.frame->pict_type));
+ d.undecoded_size = qMin(packet.data.size() - ret, packet.data.size());
+@@ -159,7 +180,11 @@ VideoFrame VideoDecoderFFmpegBase::frame()
+ frame.setBits(d.frame->data);
+ frame.setBytesPerLine(d.frame->linesize);
+ // in s. TODO: what about AVFrame.pts? av_frame_get_best_effort_timestamp? move to VideoFrame::from(AVFrame*)
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ frame.setTimestamp((double)d.frame->pkt_pts/1000.0);
++#else
++ frame.setTimestamp((double)d.frame->pts/1000.0);
++#endif
+ frame.setMetaData(QStringLiteral("avbuf"), QVariant::fromValue(AVFrameBuffersRef(new AVFrameBuffers(d.frame))));
+ d.updateColorDetails(&frame);
+ if (frame.format().hasPalette()) {
+diff --git a/src/codec/video/VideoDecoderFFmpegHW.cpp b/src/codec/video/VideoDecoderFFmpegHW.cpp
+index c17c8b28..17d663e6 100644
+--- a/src/codec/video/VideoDecoderFFmpegHW.cpp
++++ b/src/codec/video/VideoDecoderFFmpegHW.cpp
+@@ -328,7 +328,11 @@ VideoFrame VideoDecoderFFmpegHW::copyToFrame(const VideoFormat& fmt, int surface
+ // TODO: buffer pool and create VideoFrame when needed to avoid copy? also for other va
+ frame = frame.clone();
+ }
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ frame.setTimestamp(double(d.frame->pkt_pts)/1000.0);
++#else
++ frame.setTimestamp(double(d.frame->pts)/1000.0);
++#endif
+ frame.setDisplayAspectRatio(d.getDAR(d.frame));
+ d.updateColorDetails(&frame);
+ return frame;
+diff --git a/src/codec/video/VideoDecoderVAAPI.cpp b/src/codec/video/VideoDecoderVAAPI.cpp
+index a91caf92..0c8ce016 100644
+--- a/src/codec/video/VideoDecoderVAAPI.cpp
++++ b/src/codec/video/VideoDecoderVAAPI.cpp
+@@ -27,9 +27,11 @@
+ #include <QtCore/QMetaEnum>
+ #include <QtCore/QStringList>
+ #include <QtCore/QThread>
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ extern "C" {
+ #include <libavcodec/vaapi.h>
+ }
++#endif
+ #include "QtAV/private/AVCompat.h"
+ #include "QtAV/private/factory.h"
+ #include "vaapi/SurfaceInteropVAAPI.h"
+@@ -84,7 +86,7 @@ FACTORY_REGISTER(VideoDecoder, VAAPI, "VAAPI")
+
+ const char* getProfileName(AVCodecID id, int profile)
+ {
+- AVCodec *c = avcodec_find_decoder(id);
++ const AVCodec *c = avcodec_find_decoder(id);
+ if (!c)
+ return "Unknow";
+ return av_get_profile_name(c, profile);
+diff --git a/src/codec/video/VideoEncoderFFmpeg.cpp b/src/codec/video/VideoEncoderFFmpeg.cpp
+index c0c902cb..a352c533 100644
+--- a/src/codec/video/VideoEncoderFFmpeg.cpp
++++ b/src/codec/video/VideoEncoderFFmpeg.cpp
+@@ -116,11 +116,11 @@ bool VideoEncoderFFmpegPrivate::open()
+ nb_encoded = 0LL;
+ if (codec_name.isEmpty()) {
+ // copy ctx from muxer by copyAVCodecContext
+- AVCodec *codec = avcodec_find_encoder(avctx->codec_id);
++ const AVCodec *codec = avcodec_find_encoder(avctx->codec_id);
+ AV_ENSURE_OK(avcodec_open2(avctx, codec, &dict), false);
+ return true;
+ }
+- 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) {
+ const AVCodecDescriptor* cd = avcodec_descriptor_get_by_name(codec_name.toUtf8().constData());
+ if (cd) {
+@@ -247,7 +247,7 @@ bool VideoEncoderFFmpegPrivate::open()
+ applyOptionsForContext();
+ AV_ENSURE_OK(avcodec_open2(avctx, codec, &dict), false);
+ // from mpv ao_lavc
+- const int buffer_size = qMax<int>(qMax<int>(width*height*6+200, AV_INPUT_BUFFER_MIN_SIZE), sizeof(AVPicture));//??
++ const int buffer_size = qMax<int>(qMax<int>(width*height*6+200, AV_INPUT_BUFFER_MIN_SIZE), av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1));//??
+ buffer.resize(buffer_size);
+ return true;
+ }
+@@ -373,7 +373,13 @@ bool VideoEncoderFFmpeg::encode(const VideoFrame &frame)
+ pkt.data = (uint8_t*)d.buffer.constData();
+ pkt.size = d.buffer.size();
+ int got_packet = 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ int ret = avcodec_encode_video2(d.avctx, &pkt, f.data(), &got_packet);
++#else
++ int ret = avcodec_send_frame(d.avctx, f.data());
++ got_packet = (ret == 0);
++ ret = avcodec_receive_packet(d.avctx, &pkt);
++#endif
+ if (ret < 0) {
+ qWarning("error avcodec_encode_video2: %s" ,av_err2str(ret));
+ return false; //false
+diff --git a/src/filter/LibAVFilter.cpp b/src/filter/LibAVFilter.cpp
+index 8993a91f..d770ddc3 100644
+--- a/src/filter/LibAVFilter.cpp
++++ b/src/filter/LibAVFilter.cpp
+@@ -84,7 +84,9 @@ public:
+ filter_graph = 0;
+ in_filter_ctx = 0;
+ out_filter_ctx = 0;
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ avfilter_register_all();
++#endif
+ #endif //QTAV_HAVE(AVFILTER)
+ }
+ ~Private() {
+@@ -204,7 +206,9 @@ QString LibAVFilter::filterDescription(const QString &filterName)
+ {
+ QString s;
+ #if QTAV_HAVE(AVFILTER)
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ avfilter_register_all();
++#endif
+ const AVFilter *f = avfilter_get_by_name(filterName.toUtf8().constData());
+ if (!f)
+ return s;
+@@ -283,11 +287,18 @@ QStringList LibAVFilter::registeredFilters(int type)
+ {
+ QStringList filters;
+ #if QTAV_HAVE(AVFILTER)
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ avfilter_register_all();
++#endif
+ const AVFilter* f = NULL;
+ AVFilterPad* fp = NULL; // no const in avfilter_pad_get_name() for ffmpeg<=1.2 libav<=9
+ #if AV_MODULE_CHECK(LIBAVFILTER, 3, 8, 0, 53, 100)
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ while ((f = avfilter_next(f))) {
++#else
++ void** ff = NULL;
++ while (f = av_filter_iterate(ff)) {
++#endif
+ #else
+ AVFilter** ff = NULL;
+ while ((ff = av_filter_next(ff)) && *ff) {
+diff --git a/src/subtitle/SubtitleProcessorFFmpeg.cpp b/src/subtitle/SubtitleProcessorFFmpeg.cpp
+index 83e53e7c..50ccc31e 100644
+--- a/src/subtitle/SubtitleProcessorFFmpeg.cpp
++++ b/src/subtitle/SubtitleProcessorFFmpeg.cpp
+@@ -249,7 +249,7 @@ bool SubtitleProcessorFFmpeg::processHeader(const QByteArray &codec, const QByte
+ if (codec_ctx) {
+ avcodec_free_context(&codec_ctx);
+ }
+- AVCodec *c = avcodec_find_decoder_by_name(codec.constData());
++ const AVCodec *c = avcodec_find_decoder_by_name(codec.constData());
+ if (!c) {
+ qDebug("subtitle avcodec_descriptor_get_by_name %s", codec.constData());
+ const AVCodecDescriptor *desc = avcodec_descriptor_get_by_name(codec.constData());
+@@ -370,8 +370,15 @@ bool SubtitleProcessorFFmpeg::processSubtitle()
+ qWarning("no subtitle stream found");
+ return false;
+ }
++#if LIBAVCODEC_VERSION_MAJOR < 59
+ codec_ctx = m_reader.subtitleCodecContext();
+- AVCodec *dec = avcodec_find_decoder(codec_ctx->codec_id);
++ const AVCodec *dec = avcodec_find_decoder(codec_ctx->codec_id);
++#else
++ AVCodecParameters *par = m_reader.subtitleCodecContext();
++ const AVCodec *dec = avcodec_find_decoder(par->codec_id);
++ codec_ctx = avcodec_alloc_context3(dec);
++ avcodec_parameters_to_context(codec_ctx, par);
++#endif
+ const AVCodecDescriptor *dec_desc = avcodec_descriptor_get(codec_ctx->codec_id);
+ if (!dec) {
+ if (dec_desc)
diff --git a/source/l/alsa-plugins/alsa-plugins.SlackBuild b/source/l/alsa-plugins/alsa-plugins.SlackBuild
index 96b3bb654..f349bca92 100755
--- a/source/l/alsa-plugins/alsa-plugins.SlackBuild
+++ b/source/l/alsa-plugins/alsa-plugins.SlackBuild
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=alsa-plugins
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
diff --git a/source/l/clucene/clucene.SlackBuild b/source/l/clucene/clucene.SlackBuild
index f616dc495..cb2b42a0c 100755
--- a/source/l/clucene/clucene.SlackBuild
+++ b/source/l/clucene/clucene.SlackBuild
@@ -86,6 +86,9 @@ zcat $CWD/clucene.pkgconfig.patch.gz | patch -p1 --verbose || exit 1
# Fix contrib-libs installation:
zcat $CWD/clucene.install_contribs_lib.diff.gz | patch -p1 --verbose || exit 1
+# Fix FTBFS:
+zcat $CWD/clucene.ctime.diff.gz | patch -p1 --verbose || exit 1
+
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
diff --git a/source/l/clucene/clucene.ctime.diff b/source/l/clucene/clucene.ctime.diff
new file mode 100644
index 000000000..408895fe6
--- /dev/null
+++ b/source/l/clucene/clucene.ctime.diff
@@ -0,0 +1,10 @@
+--- ./src/core/CLucene/document/DateTools.cpp.orig 2011-03-16 19:21:07.000000000 -0500
++++ ./src/core/CLucene/document/DateTools.cpp 2022-10-09 15:08:11.827250428 -0500
+@@ -8,6 +8,7 @@
+
+ #include "DateTools.h"
+ #include "CLucene/util/Misc.h"
++#include <ctime>
+
+ CL_NS_USE(util)
+ CL_NS_DEF(document)
diff --git a/source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch b/source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch
new file mode 100644
index 000000000..20ea725da
--- /dev/null
+++ b/source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch
@@ -0,0 +1,31 @@
+diff '--color=auto' -rupN ffmpeg.orig/libavformat/avformat.h ffmpeg/libavformat/avformat.h
+--- ffmpeg.orig/libavformat/avformat.h 2022-08-19 17:42:47.323422603 +0200
++++ ffmpeg/libavformat/avformat.h 2022-08-19 17:42:51.347130436 +0200
+@@ -1128,6 +1128,10 @@ struct AVCodecParserContext *av_stream_g
+ */
+ int64_t av_stream_get_end_pts(const AVStream *st);
+
++// Chromium: We use the internal field first_dts vvv
++int64_t av_stream_get_first_dts(const AVStream *st);
++// Chromium: We use the internal field first_dts ^^^
++
+ #define AV_PROGRAM_RUNNING 1
+
+ /**
+diff '--color=auto' -rupN ffmpeg.orig/libavformat/mux_utils.c ffmpeg/libavformat/mux_utils.c
+--- ffmpeg.orig/libavformat/mux_utils.c 2022-08-19 17:42:47.346758108 +0200
++++ ffmpeg/libavformat/mux_utils.c 2022-08-19 17:47:28.549589002 +0200
+@@ -37,6 +37,13 @@ int64_t av_stream_get_end_pts(const AVSt
+ return AV_NOPTS_VALUE;
+ }
+
++// Chromium: We use the internal field first_dts vvv
++int64_t av_stream_get_first_dts(const AVStream *st)
++{
++ return cffstream(st)->first_dts;
++}
++// Chromium: We use the internal field first_dts ^^^
++
+ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
+ int std_compliance)
+ {
diff --git a/source/l/ffmpeg/ffmpeg.SlackBuild b/source/l/ffmpeg/ffmpeg.SlackBuild
index 49bfcc602..c4c89d998 100755
--- a/source/l/ffmpeg/ffmpeg.SlackBuild
+++ b/source/l/ffmpeg/ffmpeg.SlackBuild
@@ -3,7 +3,7 @@
# Slackware build script for ffmpeg
# Copyright 2010-2017 Heinz Wiesinger, Amsterdam, The Netherlands
-# Copyright 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2017, 2018, 2022 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -46,10 +46,10 @@ PKG=$TMP/package-$PKGNAM
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686 -fPIC"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686 -fPIC"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
@@ -131,8 +131,6 @@ ssl="" ; [ "${OPENSSL:-no}" != "no" ] && \
decklink="" ; [ "${DECKLINK:-no}" != "no" ] && \
{ decklink="--enable-decklink" ; \
SLKCFLAGS="$SLKCFLAGS -I/usr/include/decklink" ; }
-vulkan="" ; [ "${VULKAN:-no}" != "no" ] && vulkan="--enable-vulkan"
-libglslang="" ; [ "${GLSLANG:-no}" != "no" ] && libglslang="--enable-libglslang"
liblensfun="" ; [ "${LENSFUN:-no}" != "no" ] && liblensfun="--enable-liblensfun"
# Default enabled features:
@@ -163,6 +161,8 @@ libvidstab="" ; [ "${VIDSTAB:-yes}" != "no" ] && libvidstab="--enable-libvid
libxml2="" ; [ "${LIBXML2:-yes}" != "no" ] && libxml2="--enable-libxml2"
librsvg="" ; [ "${LIBRSVG:-yes}" != "no" ] && librsvg="--enable-librsvg"
libdrm="" ; [ "${LIBDRM:-yes}" != "no" ] && libdrm="--enable-libdrm"
+libglslang="" ; [ "${GLSLANG:-yes}" != "no" ] && libglslang="--enable-libglslang"
+vulkan="" ; [ "${VULKAN:-yes}" != "no" ] && vulkan="--enable-vulkan"
# No default patent encumbered features:
aac="" ; [ "${AAC:-no}" = "no" ] && aac="--disable-encoder=aac"
@@ -181,9 +181,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
-# Fix linking with flite:
-sed -i "s| -lflite\"| -lflite -lm -lasound\"|" \
- ./configure
+# Restore missing function needed by Chromium and qt-webengine:
+zcat $CWD/add-av_stream_get_first_dts-for-chromium.patch.gz | patch -p1 --verbose || exit 1
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -198,7 +197,6 @@ CXXFLAGS="$SLKCFLAGS" \
--disable-static \
--enable-gpl \
--enable-version3 \
- --enable-avresample \
--arch=$ARCH \
$non_free \
$aac \
diff --git a/source/l/gegl/gegl.SlackBuild b/source/l/gegl/gegl.SlackBuild
index 673123432..8f17c84aa 100755
--- a/source/l/gegl/gegl.SlackBuild
+++ b/source/l/gegl/gegl.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=gegl
VERSION=${VERSION:-$(echo gegl-*.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/l/gst-plugins-libav/gst-plugins-libav.SlackBuild b/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild
index fce74fbe7..6c06c0622 100755
--- a/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild
+++ b/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=gst-plugins-libav
VERSION=${VERSION:-$(echo gst-libav-*.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/l/harfbuzz/harfbuzz.url b/source/l/harfbuzz/harfbuzz.url
index 29ce27a5a..359c726db 100644
--- a/source/l/harfbuzz/harfbuzz.url
+++ b/source/l/harfbuzz/harfbuzz.url
@@ -1 +1,2 @@
-https://github.com/harfbuzz/harfbuzz/releases
+#https://github.com/harfbuzz/harfbuzz/releases
+https://github.com/harfbuzz/harfbuzz/tags
diff --git a/source/l/imagemagick/imagemagick.url b/source/l/imagemagick/imagemagick.url
index 5378667d1..c3266033e 100644
--- a/source/l/imagemagick/imagemagick.url
+++ b/source/l/imagemagick/imagemagick.url
@@ -1 +1 @@
-https://github.com/ImageMagick/ImageMagick
+https://github.com/ImageMagick/ImageMagick/tags
diff --git a/source/l/libvncserver/libvncserver.SlackBuild b/source/l/libvncserver/libvncserver.SlackBuild
index ea858caf2..082b28d39 100755
--- a/source/l/libvncserver/libvncserver.SlackBuild
+++ b/source/l/libvncserver/libvncserver.SlackBuild
@@ -28,7 +28,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=libvncserver
VERSION=${VERSION:-$(echo LibVNCServer-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
@@ -102,6 +102,7 @@ cd cmake-build
-DCMAKE_INSTALL_LIBDIR="lib$LIBDIRSUFFIX" \
-DDOC_INSTALL_DIR="doc" \
-DMAN_INSTALL_DIR=/usr/man \
+ -DWITH_FFMPEG=OFF \
.. || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
diff --git a/source/l/mlt/mlt.SlackBuild b/source/l/mlt/mlt.SlackBuild
index 66c34e9bd..8a688f399 100755
--- a/source/l/mlt/mlt.SlackBuild
+++ b/source/l/mlt/mlt.SlackBuild
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=mlt
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/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch b/source/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch
new file mode 100644
index 000000000..eb0d193ad
--- /dev/null
+++ b/source/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch
@@ -0,0 +1,20 @@
+From: Jochen Sprickerhof <jspricke@debian.org>
+Date: Mon, 8 Aug 2022 21:10:13 +0200
+Subject: Add missing header for LIBAVCODEC_VERSION_INT
+
+---
+ modules/videoio/src/ffmpeg_codecs.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/modules/videoio/src/ffmpeg_codecs.hpp b/modules/videoio/src/ffmpeg_codecs.hpp
+index 61788e0..faad259 100644
+--- a/modules/videoio/src/ffmpeg_codecs.hpp
++++ b/modules/videoio/src/ffmpeg_codecs.hpp
+@@ -60,6 +60,7 @@ extern "C" {
+ #include <errno.h>
+ #endif
+
++#include <libavcodec/version.h>
+ #include <libavformat/avformat.h>
+
+ #ifdef __cplusplus
diff --git a/source/l/opencv/opencv.SlackBuild b/source/l/opencv/opencv.SlackBuild
index cf8d59f4a..04fea2dd0 100755
--- a/source/l/opencv/opencv.SlackBuild
+++ b/source/l/opencv/opencv.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=opencv
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
@@ -88,6 +88,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+zcat $CWD/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch.gz | patch -p1 --verbose || exit 1
+
# Configure, build, and install:
mkdir cmake-build
cd cmake-build
diff --git a/source/l/pcre2/pcre2.SlackBuild b/source/l/pcre2/pcre2.SlackBuild
index 8811c0e4e..07bfdd6b8 100755
--- a/source/l/pcre2/pcre2.SlackBuild
+++ b/source/l/pcre2/pcre2.SlackBuild
@@ -27,7 +27,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=pcre2
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -100,6 +100,16 @@ make install DESTDIR=$PKG || exit 1
# Don't ship .la files:
rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
+# Move libraries, as they might be needed before /usr is available:
+mkdir $PKG/lib${LIBDIRSUFFIX}
+( cd $PKG/usr/lib${LIBDIRSUFFIX}
+ for file in lib*.so.?.* ; do
+ mv $file ../../lib${LIBDIRSUFFIX}
+ ln -sf ../../lib${LIBDIRSUFFIX}/$file .
+ done
+ cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
+)
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
diff --git a/source/l/pipewire/fetch-media-session.sh b/source/l/pipewire/fetch-media-session.sh
new file mode 100755
index 000000000..bd2e30e58
--- /dev/null
+++ b/source/l/pipewire/fetch-media-session.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Copyright 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+set -o errexit
+
+# Clear download area:
+rm -rf media-session media-session.tar media-session.tar.lz
+
+# Clone repository:
+git clone https://gitlab.freedesktop.org/pipewire/media-session.git
+
+# Cleanup. We're not packing up the whole git repo.
+rm -rf media-session/.git*
+tar cf media-session.tar media-session
+plzip -9 -n 6 -f media-session.tar
+rm -rf media-session
+echo
+echo "media-session source repo packaged"
+echo
diff --git a/source/l/pipewire/pipewire.SlackBuild b/source/l/pipewire/pipewire.SlackBuild
index 940febef9..50a817c2a 100755
--- a/source/l/pipewire/pipewire.SlackBuild
+++ b/source/l/pipewire/pipewire.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=pipewire
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
@@ -86,6 +86,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+# Add media-session:
+( cd subprojects ; tar xf $CWD/media-session.tar.lz )
+
# Configure, build, and install:
export CFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"
diff --git a/source/l/qt5/patches/qt5-webengine-ffmpeg5.patch b/source/l/qt5/patches/qt5-webengine-ffmpeg5.patch
new file mode 100644
index 000000000..58e51d0f4
--- /dev/null
+++ b/source/l/qt5/patches/qt5-webengine-ffmpeg5.patch
@@ -0,0 +1,150 @@
+diff --git a/chromium/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h
+index 2734a485cbd..70b1877a43c 100644
+--- a/chromium/media/ffmpeg/ffmpeg_common.h
++++ b/chromium/media/ffmpeg/ffmpeg_common.h
+@@ -29,6 +29,7 @@ extern "C" {
+ #include <libavformat/avformat.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/imgutils.h>
+ #include <libavutil/log.h>
+ #include <libavutil/mastering_display_metadata.h>
+diff --git a/chromium/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc
+index cb81d920def..bd73908d0ca 100644
+--- a/chromium/media/filters/audio_file_reader.cc
++++ b/chromium/media/filters/audio_file_reader.cc
+@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() {
+ }
+
+ bool AudioFileReader::OpenDecoder() {
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (codec) {
+ // MP3 decodes to S16P which we don't support, tell it to use S16 instead.
+ if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P)
+diff --git a/chromium/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc
+index 0d825ed791b..72fac6167ef 100644
+--- a/chromium/media/filters/ffmpeg_audio_decoder.cc
++++ b/chromium/media/filters/ffmpeg_audio_decoder.cc
+@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) {
+ }
+ }
+
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (!codec ||
+ avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) {
+ DLOG(ERROR) << "Could not initialize audio decoder: "
+diff --git a/chromium/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc
+index d34db63f3ef..427565b00c1 100644
+--- a/chromium/media/filters/ffmpeg_demuxer.cc
++++ b/chromium/media/filters/ffmpeg_demuxer.cc
+@@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
+
+ // Next try to use the first DTS value, for codecs where we know PTS == DTS
+ // (excludes all H26x codecs). The start time must be returned in PTS.
+- if (stream->first_dts != kNoFFmpegTimestamp &&
++ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
+ stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
+ stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
+ stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
+ const base::TimeDelta first_pts =
+- ConvertFromTimeBase(stream->time_base, stream->first_dts);
++ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
+ if (first_pts < start_time)
+ start_time = first_pts;
+ }
+@@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ scoped_refptr<DecoderBuffer> buffer;
+
+ if (type() == DemuxerStream::TEXT) {
+- int id_size = 0;
++ size_t id_size = 0;
+ uint8_t* id_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+
+- int settings_size = 0;
++ size_t settings_size = 0;
+ uint8_t* settings_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+
+@@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+ side_data.data(), side_data.size());
+ } else {
+- int side_data_size = 0;
++ size_t side_data_size = 0;
+ uint8_t* side_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+
+@@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ packet->size - data_offset);
+ }
+
+- int skip_samples_size = 0;
++ size_t skip_samples_size = 0;
+ const uint32_t* skip_samples_ptr =
+ reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
+diff --git a/chromium/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc
+index 0ef3521473d..8483ecc348f 100644
+--- a/chromium/media/filters/ffmpeg_glue.cc
++++ b/chromium/media/filters/ffmpeg_glue.cc
+@@ -59,7 +59,6 @@ static int64_t AVIOSeekOperation(void* opaque, int64_t offset, int whence) {
+ }
+
+ void FFmpegGlue::InitializeFFmpeg() {
+- av_register_all();
+ }
+
+ static void LogContainer(bool is_local_file,
+@@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) {
+ // Enable fast, but inaccurate seeks for MP3.
+ format_context_->flags |= AVFMT_FLAG_FAST_SEEK;
+
+- // Ensures we can read out various metadata bits like vp8 alpha.
+- format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA;
+-
+ // Ensures format parsing errors will bail out. From an audit on 11/2017, all
+ // instances were real failures. Solves bugs like http://crbug.com/710791.
+ format_context_->error_recognition |= AV_EF_EXPLODE;
+diff --git a/chromium/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc
+index ef12477ee89..7996606f5f9 100644
+--- a/chromium/media/filters/ffmpeg_video_decoder.cc
++++ b/chromium/media/filters/ffmpeg_video_decoder.cc
+@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config,
+ if (decode_nalus_)
+ codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
+
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
+ ReleaseFFmpegResources();
+ return false;
+diff --git a/chromium/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc
+index 59c2a2fc618..1a9872c7acb 100644
+--- a/chromium/media/filters/media_file_checker.cc
++++ b/chromium/media/filters/media_file_checker.cc
+@@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) {
+ auto context = AVStreamToAVCodecContext(format_context->streams[i]);
+ if (!context)
+ continue;
+- AVCodec* codec = avcodec_find_decoder(cp->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
+ if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
+ auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
+ stream_contexts[i] = {std::move(context), std::move(loop)};
+diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+index 9002b874611..d12fade8b63 100644
+--- a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
++++ b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings,
+ // a pointer |this|.
+ av_context_->opaque = this;
+
+- AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
+ if (!codec) {
+ // This is an indication that FFmpeg has not been initialized or it has not
+ // been compiled/initialized with the correct set of codecs.
diff --git a/source/l/qt5/qt5.SlackBuild b/source/l/qt5/qt5.SlackBuild
index c8cf9cf13..2edffbfaf 100755
--- a/source/l/qt5/qt5.SlackBuild
+++ b/source/l/qt5/qt5.SlackBuild
@@ -140,6 +140,11 @@ cd qtwebengine/src/3rdparty
zcat $CWD/patches/qt5-webengine-gcc12.patch.gz | patch -p1 --verbose || exit 1
cd - 1>/dev/null
+# Fix build with ffmpeg-5:
+cd qtwebengine/src/3rdparty
+ zcat $CWD/patches/qt5-webengine-ffmpeg5.patch.gz | patch -p1 --verbose || exit 1
+cd - 1>/dev/null
+
# CMake generates wrong -isystem /usr/include compilations flags with Qt5::Gui
# and for it breaks KWin compilation with:
# /usr/include/c++/9.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory