summaryrefslogtreecommitdiffstats
path: root/source/l
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2023-10-27 19:47:36 +0000
committer Eric Hameleers <alien@slackware.com>2023-10-27 22:34:33 +0200
commitf4d1448dd43416a6f46af26fa4422de1c626cfc7 (patch)
tree0edc43da9a23002aba6d0c71aea8144c4922a271 /source/l
parent05ec45c9c979a958e022fe691e6cf03a338e9263 (diff)
downloadcurrent-f4d1448dd43416a6f46af26fa4422de1c626cfc7.tar.gz
current-f4d1448dd43416a6f46af26fa4422de1c626cfc7.tar.xz
Fri Oct 27 19:47:36 UTC 202320231027194736
a/exfatprogs-1.2.2-x86_64-1.txz: Upgraded. kde/digikam-8.1.0-x86_64-2.txz: Rebuilt. Recompiled against exiv2-0.28.0. kde/gwenview-23.08.2-x86_64-2.txz: Rebuilt. Recompiled against exiv2-0.28.0. kde/kfilemetadata-5.111.0-x86_64-2.txz: Rebuilt. Recompiled against exiv2-0.28.0. kde/krename-5.0.2-x86_64-2.txz: Rebuilt. Recompiled against exiv2-0.28.0. kde/krita-5.2.0-x86_64-2.txz: Rebuilt. Recompiled against exiv2-0.28.0. kde/libkexiv2-23.08.2-x86_64-2.txz: Rebuilt. Recompiled against exiv2-0.28.0. l/QtAV-20220226_fdc613dc-x86_64-1.txz: Removed. This is no longer used by digikam, so let's just remove it. l/exiv2-0.28.0-x86_64-1.txz: Upgraded. Shared library .so-version bump. l/libsoup3-3.4.4-x86_64-1.txz: Upgraded. n/c-ares-1.21.0-x86_64-1.txz: Upgraded. n/gpgme-1.23.1-x86_64-1.txz: Upgraded. n/nghttp2-1.58.0-x86_64-1.txz: Upgraded. xap/geeqie-2.1-x86_64-3.txz: Rebuilt. Recompiled against exiv2-0.28.0.
Diffstat (limited to 'source/l')
-rw-r--r--source/l/FTBFSlog4
-rwxr-xr-xsource/l/QtAV/QtAV.SlackBuild140
-rw-r--r--source/l/QtAV/QtAV.url1
-rw-r--r--source/l/QtAV/doinst.sh3
-rwxr-xr-xsource/l/QtAV/fetch-QtAV.sh52
-rw-r--r--source/l/QtAV/ffmpeg5.patch947
-rw-r--r--source/l/QtAV/slack-desc19
-rwxr-xr-xsource/l/exiv2/exiv2.SlackBuild8
-rw-r--r--source/l/exiv2/patches/16c1cd7d.patch98
-rw-r--r--source/l/exiv2/patches/3664f5b8.patch275
-rw-r--r--source/l/exiv2/patches/b4f435a4.patch23
-rw-r--r--source/l/exiv2/patches/f47e7bd6.patch25
-rwxr-xr-xsource/l/ffmpeg/ffmpeg.SlackBuild5
-rw-r--r--source/l/ffmpeg/texinfo.patch283
14 files changed, 719 insertions, 1164 deletions
diff --git a/source/l/FTBFSlog b/source/l/FTBFSlog
index 00c73adf7..e61c32a4e 100644
--- a/source/l/FTBFSlog
+++ b/source/l/FTBFSlog
@@ -1,3 +1,7 @@
+Fri Oct 27 17:55:58 UTC 2023
+ ffmpeg: fix building HTML documentation with texinfo-7.1.
+ Thanks to rizitis.
++--------------------------+
Sat Oct 14 19:43:09 UTC 2023
qt5: fix build with libxkbcommon-1.6.0. Thanks to lucabon.
+--------------------------+
diff --git a/source/l/QtAV/QtAV.SlackBuild b/source/l/QtAV/QtAV.SlackBuild
deleted file mode 100755
index aab178574..000000000
--- a/source/l/QtAV/QtAV.SlackBuild
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/bin/bash
-
-# Copyright 2017, 2019 Eric Hameleers, Eindhoven, NL
-# Copyright 2020 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.
-
-cd $(dirname $0) ; CWD=$(pwd)
-
-PKGNAM=QtAV
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
-
-# Automatically determine the architecture we're building on:
-if [ -z "$ARCH" ]; then
- case "$(uname -m)" in
- i?86) ARCH=i586 ;;
- arm*) readelf /usr/bin/file -A | grep -E -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
- *) ARCH=$(uname -m) ;;
- esac
- export ARCH
-fi
-
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
-if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
- echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
- exit 0
-fi
-
-NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "}
-
-if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-elif [ "$ARCH" = "armv7hl" ]; then
- SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
- LIBDIRSUFFIX=""
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PKGNAM
-
-rm -rf $PKG
-mkdir -p $TMP $PKG
-
-cd $TMP
-rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
-cd $PKGNAM-$VERSION || exit 1
-
-chown -R root:root .
-find . \
- \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \+ -o \
- \( -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"
-
-qmake-qt5 INSTALL_PREFIX=/usr "CONFIG+=no-tests no_rpath recheck"
-make $NUMJOBS || make || exit 1
-make INSTALL_ROOT=$PKG install || exit 1
-
-# Create symlinks for the binaries; these are referenced in *.desktop:
-mkdir -p $PKG/usr/bin
-( cd $PKG/usr/bin
- ln -s ../lib${LIBDIRSUFFIX}/qt5/bin/Player .
- ln -s ../lib${LIBDIRSUFFIX}/qt5/bin/QMLPlayer .
-)
-
-# Fix documentation directory:
-mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
-mv $PKG/usr/share/doc/* $PKG/usr/doc/$PKGNAM-$VERSION/
-rmdir $PKG/usr/share/doc
-
-# Strip binaries:
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# Compress manual pages:
-find $PKG/usr/man -type f -exec gzip -9 {} \+
-for i in $( find $PKG/usr/man -type l ) ; do
- ln -s $( readlink $i ).gz $i.gz
- rm $i
-done
-
-# Add a documentation directory:
-mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
-cp -a \
- AUTHORS* ChangeLog CHANGES COPYING* LICENSE* NEWS* README* THANKS* TODO* \
- $PKG/usr/doc/${PKGNAM}-$VERSION
-
-# If there's a ChangeLog, installing at least part of the recent history
-# is useful, but don't let it get totally out of control:
-if [ -r ChangeLog ]; then
- DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
- cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
- touch -r ChangeLog $DOCSDIR/ChangeLog
-fi
-
-mkdir -p $PKG/install
-zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
-cat $CWD/slack-desc > $PKG/install/slack-desc
-
-cd $PKG
-/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/source/l/QtAV/QtAV.url b/source/l/QtAV/QtAV.url
deleted file mode 100644
index 8927fd5b6..000000000
--- a/source/l/QtAV/QtAV.url
+++ /dev/null
@@ -1 +0,0 @@
-https://github.com/wang-bin/QtAV
diff --git a/source/l/QtAV/doinst.sh b/source/l/QtAV/doinst.sh
deleted file mode 100644
index 5fb28930d..000000000
--- a/source/l/QtAV/doinst.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ -x /usr/bin/update-desktop-database ]; then
- /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
-fi
diff --git a/source/l/QtAV/fetch-QtAV.sh b/source/l/QtAV/fetch-QtAV.sh
deleted file mode 100755
index d802d7add..000000000
--- a/source/l/QtAV/fetch-QtAV.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-# Copyright 2019, 2020 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.
-
-
-PKGNAM=QtAV
-
-# Pull a stable branch + patches
-BRANCH=${1:-master}
-
-# Clear download area:
-rm -rf ${PKGNAM}
-
-# Clone repository:
-git clone https://github.com/wang-bin/QtAV
-
-# checkout $BRANCH:
-( cd ${PKGNAM}
- git checkout $BRANCH || exit 1
-)
-
-HEADISAT="$( cd ${PKGNAM} && git log -1 --format=%h )"
-DATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%Y%m%d )"
-LONGDATE="$( cd ${PKGNAM} && git log -1 --format=%cd --date=format:%c )"
-# Cleanup. We're not packing up the whole git repo.
-( cd ${PKGNAM} && find . -type d -name ".git*" -exec rm -rf {} \; 2> /dev/null )
-mv ${PKGNAM} ${PKGNAM}-${DATE}_${HEADISAT}
-tar cf ${PKGNAM}-${DATE}_${HEADISAT}.tar ${PKGNAM}-${DATE}_${HEADISAT}
-plzip -9 -f ${PKGNAM}-${DATE}_${HEADISAT}.tar
-rm -rf ${PKGNAM}-${DATE}_${HEADISAT}
-touch -d "$LONGDATE" ${PKGNAM}-${DATE}_${HEADISAT}.tar.lz
-echo
-echo "${PKGNAM} branch $BRANCH with HEAD at $HEADISAT packaged as ${PKGNAM}-${DATE}_${HEADISAT}.tar.lz"
-echo
diff --git a/source/l/QtAV/ffmpeg5.patch b/source/l/QtAV/ffmpeg5.patch
deleted file mode 100644
index 53e60b8ff..000000000
--- a/source/l/QtAV/ffmpeg5.patch
+++ /dev/null
@@ -1,947 +0,0 @@
-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/QtAV/slack-desc b/source/l/QtAV/slack-desc
deleted file mode 100644
index 95f8483f0..000000000
--- a/source/l/QtAV/slack-desc
+++ /dev/null
@@ -1,19 +0,0 @@
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
-# up the first '|' above the ':' following the base package name, and the '|'
-# on the right side marks the last column you can put a character in. You must
-# make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':'.
-
- |-----handy-ruler------------------------------------------------------|
-QtAV: QtAV (multimedia playback framework)
-QtAV:
-QtAV: QtAV is a multimedia playback framework based on Qt and FFmpeg. Some
-QtAV: components in QtAV are designed to be extensible.
-QtAV:
-QtAV: Homepage: http://qtav.org
-QtAV:
-QtAV:
-QtAV:
-QtAV:
-QtAV:
diff --git a/source/l/exiv2/exiv2.SlackBuild b/source/l/exiv2/exiv2.SlackBuild
index 6d49c6900..49928b8b5 100755
--- a/source/l/exiv2/exiv2.SlackBuild
+++ b/source/l/exiv2/exiv2.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 2007 Frank Caraballo <fecaraballo{at}gmail{dot}com>
-# Copyright 2008, 2009, 2011, 2015, 2017, 2018, 2019, 2020 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2011, 2015, 2017, 2018, 2019, 2020, 2023 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -80,6 +80,12 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
+# Upstream regression patches:
+cat $CWD/patches/16c1cd7d.patch | patch -p1 --verbose || exit 1
+cat $CWD/patches/3664f5b8.patch | patch -p1 --verbose || exit 1
+cat $CWD/patches/b4f435a4.patch | patch -p1 --verbose || exit 1
+cat $CWD/patches/f47e7bd6.patch | patch -p1 --verbose || exit 1
+
# Configure, build, and install:
mkdir cmake-build
cd cmake-build
diff --git a/source/l/exiv2/patches/16c1cd7d.patch b/source/l/exiv2/patches/16c1cd7d.patch
new file mode 100644
index 000000000..fc8dc9b28
--- /dev/null
+++ b/source/l/exiv2/patches/16c1cd7d.patch
@@ -0,0 +1,98 @@
+From 16c1cd7da0cd159ee2d53c39088564edaf046c77 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?=
+ <miloskomarcevic@aim.com>
+Date: Fri, 16 Jun 2023 17:05:39 +0200
+Subject: [PATCH] Fix regression parsing PNG text chunks with zero length
+ payload
+
+---
+ src/pngchunk_int.cpp | 37 ++++++++++++++++++-------------------
+ 1 file changed, 18 insertions(+), 19 deletions(-)
+
+diff --git a/src/pngchunk_int.cpp b/src/pngchunk_int.cpp
+index 697a30c63c..81fbcd942d 100644
+--- a/src/pngchunk_int.cpp
++++ b/src/pngchunk_int.cpp
+@@ -100,20 +100,24 @@ DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkTyp
+ }
+
+ // compressed string after the compression technique spec
+- const byte* compressedText = data.c_data(keysize + nullSeparators);
+ size_t compressedTextSize = data.size() - keysize - nullSeparators;
+- enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
++ if (compressedTextSize) {
++ const byte* compressedText = data.c_data(keysize + nullSeparators);
++ enforce(compressedTextSize < data.size(), ErrorCode::kerCorruptedMetadata);
+
+- zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
++ zlibUncompress(compressedText, static_cast<uint32_t>(compressedTextSize), arr);
++ }
+ } else if (type == tEXt_Chunk) {
+ enforce(data.size() >= Safe::add(keysize, static_cast<size_t>(1)), ErrorCode::kerCorruptedMetadata);
+ // Extract a non-compressed Latin-1 text chunk
+
+ // the text comes after the key, but isn't null terminated
+- const byte* text = data.c_data(keysize + 1);
+ size_t textsize = data.size() - keysize - 1;
++ if (textsize) {
++ const byte* text = data.c_data(keysize + 1);
+
+- arr = DataBuf(text, textsize);
++ arr = DataBuf(text, textsize);
++ }
+ } else if (type == iTXt_Chunk) {
+ enforce(data.size() > Safe::add(keysize, static_cast<size_t>(3)), ErrorCode::kerCorruptedMetadata);
+ const size_t nullCount = std::count(data.c_data(keysize + 3), data.c_data(data.size() - 1), '\0');
+@@ -127,7 +131,8 @@ DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkTyp
+ const byte compressionMethod = data.read_uint8(keysize + 2);
+
+ enforce(compressionFlag == 0x00 || compressionFlag == 0x01, ErrorCode::kerCorruptedMetadata);
+- enforce(compressionMethod == 0x00, ErrorCode::kerCorruptedMetadata);
++ if (compressionFlag == 0x01)
++ enforce(compressionMethod == 0x00, ErrorCode::kerFailedToReadImageData);
+
+ // language description string after the compression technique spec
+ const size_t languageTextMaxSize = data.size() - keysize - 3;
+@@ -141,14 +146,14 @@ DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkTyp
+ data.size() - (keysize + 3 + languageTextSize + 1));
+ const size_t translatedKeyTextSize = translatedKeyText.size();
+
+- if ((compressionFlag == 0x00) || (compressionFlag == 0x01 && compressionMethod == 0x00)) {
+- enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, static_cast<size_t>(1))) <=
+- data.size(),
+- ErrorCode::kerCorruptedMetadata);
++ enforce(Safe::add(keysize + 3 + languageTextSize + 1, Safe::add(translatedKeyTextSize, static_cast<size_t>(1))) <=
++ data.size(),
++ ErrorCode::kerCorruptedMetadata);
+
++ const auto textsize =
++ static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
++ if (textsize) {
+ const byte* text = data.c_data(keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1);
+- const auto textsize =
+- static_cast<long>(data.size() - (keysize + 3 + languageTextSize + 1 + translatedKeyTextSize + 1));
+
+ if (compressionFlag == 0x00) {
+ // then it's an uncompressed iTXt chunk
+@@ -156,7 +161,7 @@ DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkTyp
+ std::cout << "Exiv2::PngChunk::parseTXTChunk: We found an uncompressed iTXt field\n";
+ #endif
+ arr = DataBuf(text, textsize);
+- } else if (compressionFlag == 0x01 && compressionMethod == 0x00) {
++ } else {
+ // then it's a zlib compressed iTXt chunk
+ #ifdef EXIV2_DEBUG_MESSAGES
+ std::cout << "Exiv2::PngChunk::parseTXTChunk: We found a zlib compressed iTXt field\n";
+@@ -165,12 +170,6 @@ DataBuf PngChunk::parseTXTChunk(const DataBuf& data, size_t keysize, TxtChunkTyp
+ // the compressed text comes after the translated keyword, but isn't null terminated
+ zlibUncompress(text, textsize, arr);
+ }
+- } else {
+- // then it isn't zlib compressed and we are sunk
+-#ifdef EXIV2_DEBUG_MESSAGES
+- std::cerr << "Exiv2::PngChunk::parseTXTChunk: Non-standard iTXt compression method.\n";
+-#endif
+- throw Error(ErrorCode::kerFailedToReadImageData);
+ }
+ } else {
+ #ifdef DEBUG
diff --git a/source/l/exiv2/patches/3664f5b8.patch b/source/l/exiv2/patches/3664f5b8.patch
new file mode 100644
index 000000000..4a14765b7
--- /dev/null
+++ b/source/l/exiv2/patches/3664f5b8.patch
@@ -0,0 +1,275 @@
+From 360c6cd41f15baf6d999da12e1fc077180f5da91 Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <kevinbackhouse@github.com>
+Date: Sun, 25 Jun 2023 16:14:06 +0100
+Subject: [PATCH 1/2] Check if the metadata is NULL.
+
+---
+ src/nikonmn_int.cpp | 16 ++++++++--------
+ src/sonymn_int.cpp | 4 ++--
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp
+index 2887c1b621..949023d00e 100644
+--- a/src/nikonmn_int.cpp
++++ b/src/nikonmn_int.cpp
+@@ -3384,7 +3384,7 @@ std::ostream& Nikon3MakerNote::printExternalFlashData2(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashMasterDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3413,7 +3413,7 @@ std::ostream& Nikon3MakerNote::printFlashMasterDataFl6(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashMasterDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3480,7 +3480,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupBCControlData(std::ostream& os, co
+
+ std::ostream& Nikon3MakerNote::printFlashGroupADataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3509,7 +3509,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupADataFl6(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashGroupADataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3538,7 +3538,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupADataFl7(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashGroupBDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3567,7 +3567,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupBDataFl6(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashGroupBDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3596,7 +3596,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupBDataFl7(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashGroupCDataFl6(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+@@ -3625,7 +3625,7 @@ std::ostream& Nikon3MakerNote::printFlashGroupCDataFl6(std::ostream& os, const V
+
+ std::ostream& Nikon3MakerNote::printFlashGroupCDataFl7(std::ostream& os, const Value& value, const ExifData* metadata) {
+ std::ios::fmtflags f(os.flags());
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ os.flags(f);
+ return os;
+diff --git a/src/sonymn_int.cpp b/src/sonymn_int.cpp
+index f2950c4608..2fe62bdbf2 100644
+--- a/src/sonymn_int.cpp
++++ b/src/sonymn_int.cpp
+@@ -1799,7 +1799,7 @@ const TagInfo* SonyMakerNote::tagListFp() {
+
+ std::ostream& SonyMakerNote::printSony2FpAmbientTemperature(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1)
++ if (value.count() != 1 || !metadata)
+ return os << "(" << value << ")";
+
+ auto pos = metadata->findKey(ExifKey("Exif.Sony2Fp.0x0002"));
+@@ -1879,7 +1879,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc1() {
+
+ std::ostream& SonyMakerNote::printSonyMisc1CameraTemperature(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1)
++ if (value.count() != 1 || !metadata)
+ return os << "(" << value << ")";
+
+ auto pos = metadata->findKey(ExifKey("Exif.SonyMisc1.0x0004"));
+
+From 1119a68a1e90b5a278f4ecc70461bfca786eee0d Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <kevinbackhouse@github.com>
+Date: Sun, 25 Jun 2023 22:23:24 +0100
+Subject: [PATCH 2/2] Check if the metadata is NULL.
+
+---
+ src/sonymn_int.cpp | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/src/sonymn_int.cpp b/src/sonymn_int.cpp
+index 2fe62bdbf2..a2cde2282c 100644
+--- a/src/sonymn_int.cpp
++++ b/src/sonymn_int.cpp
+@@ -827,7 +827,7 @@ std::ostream& SonyMakerNote::printWBShiftABGM(std::ostream& os, const Value& val
+ }
+
+ std::ostream& SonyMakerNote::printFocusMode2(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -854,7 +854,7 @@ std::ostream& SonyMakerNote::printFocusMode2(std::ostream& os, const Value& valu
+ }
+
+ std::ostream& SonyMakerNote::printAFAreaModeSetting(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -891,7 +891,7 @@ std::ostream& SonyMakerNote::printAFAreaModeSetting(std::ostream& os, const Valu
+ }
+
+ std::ostream& SonyMakerNote::printFlexibleSpotPosition(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 2 || value.typeId() != unsignedShort) {
++ if (value.count() != 2 || value.typeId() != unsignedShort || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -916,7 +916,7 @@ std::ostream& SonyMakerNote::printFlexibleSpotPosition(std::ostream& os, const V
+ }
+
+ std::ostream& SonyMakerNote::printAFPointSelected(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -967,7 +967,7 @@ std::ostream& SonyMakerNote::printAFPointSelected(std::ostream& os, const Value&
+ }
+
+ std::ostream& SonyMakerNote::printAFPointsUsed(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.typeId() != unsignedByte) {
++ if (value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -994,7 +994,7 @@ std::ostream& SonyMakerNote::printAFPointsUsed(std::ostream& os, const Value& va
+ }
+
+ std::ostream& SonyMakerNote::printAFTracking(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedByte) {
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -1297,7 +1297,7 @@ std::ostream& SonyMakerNote::printImageSize(std::ostream& os, const Value& value
+ }
+
+ std::ostream& SonyMakerNote::printFocusMode(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedShort) {
++ if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -1314,7 +1314,7 @@ std::ostream& SonyMakerNote::printFocusMode(std::ostream& os, const Value& value
+ }
+
+ std::ostream& SonyMakerNote::printAFMode(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedShort) {
++ if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -1336,7 +1336,7 @@ std::ostream& SonyMakerNote::printAFMode(std::ostream& os, const Value& value, c
+ }
+
+ std::ostream& SonyMakerNote::printFocusMode3(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedShort) {
++ if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -1353,7 +1353,7 @@ std::ostream& SonyMakerNote::printFocusMode3(std::ostream& os, const Value& valu
+
+ std::ostream& SonyMakerNote::printHighISONoiseReduction2(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedShort) {
++ if (value.count() != 1 || value.typeId() != unsignedShort || !metadata) {
+ os << "(" << value << ")";
+ return os;
+ }
+@@ -1840,7 +1840,7 @@ std::ostream& SonyMakerNote::printSony2FpFocusMode(std::ostream& os, const Value
+
+ std::ostream& SonyMakerNote::printSony2FpFocusPosition2(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1)
++ if (value.count() != 1 || !metadata)
+ os << "(" << value << ")";
+ else {
+ std::string model;
+@@ -1944,7 +1944,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc2b() {
+
+ std::ostream& SonyMakerNote::printSonyMisc2bLensZoomPosition(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1)
++ if (value.count() != 1 || !metadata)
+ return os << "(" << value << ")";
+
+ std::string model;
+@@ -1966,7 +1966,7 @@ std::ostream& SonyMakerNote::printSonyMisc2bLensZoomPosition(std::ostream& os, c
+
+ std::ostream& SonyMakerNote::printSonyMisc2bFocusPosition2(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1)
++ if (value.count() != 1 || !metadata)
+ return os << "(" << value << ")";
+
+ std::string model;
+@@ -2052,7 +2052,7 @@ const TagInfo* SonyMakerNote::tagListSonyMisc3c() {
+
+ std::ostream& SonyMakerNote::printSonyMisc3cShotNumberSincePowerUp(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedLong)
++ if (value.count() != 1 || value.typeId() != unsignedLong || !metadata)
+ return os << "(" << value << ")";
+
+ std::string model;
+@@ -2083,7 +2083,7 @@ std::ostream& SonyMakerNote::printSonyMisc3cSequenceNumber(std::ostream& os, con
+ }
+
+ std::ostream& SonyMakerNote::printSonyMisc3cQuality2(std::ostream& os, const Value& value, const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedByte)
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata)
+ return os << "(" << value << ")";
+
+ std::string model;
+@@ -2108,7 +2108,7 @@ std::ostream& SonyMakerNote::printSonyMisc3cQuality2(std::ostream& os, const Val
+
+ std::ostream& SonyMakerNote::printSonyMisc3cSonyImageHeight(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedShort)
++ if (value.count() != 1 || value.typeId() != unsignedShort || !metadata)
+ return os << "(" << value << ")";
+
+ std::string model;
+@@ -2131,7 +2131,7 @@ std::ostream& SonyMakerNote::printSonyMisc3cSonyImageHeight(std::ostream& os, co
+
+ std::ostream& SonyMakerNote::printSonyMisc3cModelReleaseYear(std::ostream& os, const Value& value,
+ const ExifData* metadata) {
+- if (value.count() != 1 || value.typeId() != unsignedByte)
++ if (value.count() != 1 || value.typeId() != unsignedByte || !metadata)
+ return os << "(" << value << ")";
+
+ std::string model;
diff --git a/source/l/exiv2/patches/b4f435a4.patch b/source/l/exiv2/patches/b4f435a4.patch
new file mode 100644
index 000000000..8332a1e84
--- /dev/null
+++ b/source/l/exiv2/patches/b4f435a4.patch
@@ -0,0 +1,23 @@
+From b4f435a4ecceba0ef3a785dbe8eead6f55f49cc1 Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <kevinbackhouse@github.com>
+Date: Sat, 17 Jun 2023 13:39:15 +0100
+Subject: [PATCH] Avoid triggering assertion in std::vector::operator[]
+
+(cherry picked from commit 3202e86e737ea181a1904c9d3b9a6b619c3baba5)
+---
+ src/types.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/types.cpp b/src/types.cpp
+index 6559e20f4d..1c6963cda4 100644
+--- a/src/types.cpp
++++ b/src/types.cpp
+@@ -173,7 +173,7 @@ byte* Exiv2::DataBuf::data(size_t offset) {
+ }
+
+ const byte* Exiv2::DataBuf::c_data(size_t offset) const {
+- if (pData_.empty()) {
++ if (pData_.empty() || offset == pData_.size()) {
+ return nullptr;
+ }
+ if (offset > pData_.size()) {
diff --git a/source/l/exiv2/patches/f47e7bd6.patch b/source/l/exiv2/patches/f47e7bd6.patch
new file mode 100644
index 000000000..1b74678a5
--- /dev/null
+++ b/source/l/exiv2/patches/f47e7bd6.patch
@@ -0,0 +1,25 @@
+From f47e7bd666aa063d016bdf00ea8f62c97a5b5a7a Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <kevinbackhouse@github.com>
+Date: Sat, 17 Jun 2023 13:10:07 +0100
+Subject: [PATCH] Fix unit test failure.
+
+(cherry picked from commit 33071f33b2996a3ccbdd51f8cc3b958b5eed0e0b)
+---
+ unitTests/test_types.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/unitTests/test_types.cpp b/unitTests/test_types.cpp
+index 5cfd80d5e9..b13bbc6825 100644
+--- a/unitTests/test_types.cpp
++++ b/unitTests/test_types.cpp
+@@ -49,8 +49,8 @@ TEST(DataBuf, canBeConstructedFromExistingData) {
+ TEST(DataBuf, tryingToAccessTooFarElementThrows) {
+ const std::array<byte, 4> data{'h', 'o', 'l', 'a'};
+ DataBuf instance(data.data(), data.size());
+- ASSERT_THROW([[maybe_unused]] auto d = instance.data(4), std::out_of_range);
+- ASSERT_THROW([[maybe_unused]] auto d = instance.c_data(4), std::out_of_range);
++ ASSERT_THROW([[maybe_unused]] auto d = instance.data(5), std::out_of_range);
++ ASSERT_THROW([[maybe_unused]] auto d = instance.c_data(5), std::out_of_range);
+ }
+
+ TEST(DataBuf, readUintFunctionsWorksOnExistingData) {
diff --git a/source/l/ffmpeg/ffmpeg.SlackBuild b/source/l/ffmpeg/ffmpeg.SlackBuild
index e85d9982f..5eb122cb2 100755
--- a/source/l/ffmpeg/ffmpeg.SlackBuild
+++ b/source/l/ffmpeg/ffmpeg.SlackBuild
@@ -175,6 +175,9 @@ rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
cd $PKGNAM-$VERSION || exit 1
+# Fix texinfo-7.1 regression:
+zcat $CWD/texinfo.patch.gz | patch -p1 --verbose || exit 1
+
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -186,7 +189,7 @@ find -L . \
zcat $CWD/add-av_stream_get_first_dts-for-chromium.patch.gz | patch -p1 --verbose || exit 1
# Upstream patch to build with binutils-2.41:
-cat $CWD/effadce6c756247ea8bae32dc13bb3e6f464f0eb.patch | patch -p1 --verbose || exit 1
+zcat $CWD/effadce6c756247ea8bae32dc13bb3e6f464f0eb.patch.gz | patch -p1 --verbose || exit 1
# Build against recent Vulkan:
zcat $CWD/ffmpeg.vulkan.diff.gz | patch -p1 --verbose || exit 1
diff --git a/source/l/ffmpeg/texinfo.patch b/source/l/ffmpeg/texinfo.patch
new file mode 100644
index 000000000..2de58c150
--- /dev/null
+++ b/source/l/ffmpeg/texinfo.patch
@@ -0,0 +1,283 @@
+--- ffmpeg-6.0/doc/t2h.pm 2022-11-04 22:16:28.000000000 +0200
++++ t2h.pm.BAK 2023-10-26 00:47:01.128352085 +0300
+@@ -19,9 +19,11 @@
+ # You should have received a copy of the GNU General Public
+ # License along with FFmpeg; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++use lib '/usr/share/texinfo/Texinfo/Convert';
++use Texinfo::Convert::Converter;
+
+ # no navigation elements
+-set_from_init_file('HEADERS', 0);
++texinfo_set_from_init_file('HEADERS', 0);
+
+ sub ffmpeg_heading_command($$$$$)
+ {
+@@ -60,66 +62,68 @@
+ }
+
+ my $heading_level;
+- # node is used as heading if there is nothing else.
+- if ($cmdname eq 'node') {
+- if (!$element or (!$element->{'extra'}->{'section'}
+- and $element->{'extra'}->{'node'}
+- and $element->{'extra'}->{'node'} eq $command
+- # bogus node may not have been normalized
+- and defined($command->{'extra'}->{'normalized'}))) {
+- if ($command->{'extra'}->{'normalized'} eq 'Top') {
+- $heading_level = 0;
+- } else {
+- $heading_level = 3;
+- }
+- }
++
++if ($cmdname eq 'node') {
++ if (!$element or (
++ $element->{'extra'}->{'section'} and
++ $element->{'extra'}->{'node'} and
++ $element->{'extra'}->{'node'} eq $command and
++ defined($command->{'extra'}->{'normalized'})
++ )) {
++ $heading_level = 0; # Set heading level to 0
+ } else {
+- $heading_level = $command->{'level'};
++ $heading_level = 3;
+ }
++} else {
++ $heading_level = $command->{'level'};
++}
+
+- my $heading = $self->command_text($command);
+- # $heading not defined may happen if the command is a @node, for example
+- # if there is an error in the node.
+- if (defined($heading) and $heading ne '' and defined($heading_level)) {
+-
+- if ($Texinfo::Common::root_commands{$cmdname}
+- and $Texinfo::Common::sectioning_commands{$cmdname}) {
+- my $content_href = $self->command_contents_href($command, 'contents',
+- $self->{'current_filename'});
+- if ($content_href) {
+- my $this_href = $content_href =~ s/^\#toc-/\#/r;
+- $heading .= '<span class="pull-right">'.
+- '<a class="anchor hidden-xs" '.
+- "href=\"$this_href\" aria-hidden=\"true\">".
+- ($ENV{"FA_ICONS"} ? '<i class="fa fa-link"></i>'
+- : '#').
+- '</a> '.
+- '<a class="anchor hidden-xs"'.
+- "href=\"$content_href\" aria-hidden=\"true\">".
+- ($ENV{"FA_ICONS"} ? '<i class="fa fa-navicon"></i>'
+- : 'TOC').
+- '</a>'.
+- '</span>';
+- }
++my $heading = $self->command_text($command);
++
++if (defined($heading) and $heading ne '' and defined($heading_level)) {
++ if ($Texinfo::Common::root_commands{$cmdname}
++ and $Texinfo::Common::sectioning_commands{$cmdname}) {
++ my $content_href = $self->command_contents_href($command, 'contents', $self->{'current_filename'});
++ if ($content_href) {
++ my $this_href = $content_href =~ s/^\#toc-/\#/r;
++ $heading .= '<span class="pull-right">'.
++ '<a class="anchor hidden-xs" '.
++ "href=\"$this_href\" aria-hidden=\"true\">".
++ ($ENV{"FA_ICONS"} ? '<i class="fa fa-link"></i>'
++ : '#').
++ '</a> ' .
++ '<a class="anchor hidden-xs"'.
++ "href=\"$content_href\" aria-hidden=\"true\">".
++ ($ENV{"FA_ICONS"} ? '<i class="fa fa-navicon"></i>'
++ : 'TOC').
++ '</a>'.
++ '</span>';
+ }
++ }
+
+- if ($self->in_preformatted()) {
+- $result .= $heading."\n";
+- } else {
+- # if the level was changed, set the command name right
+- if ($cmdname ne 'node'
+- and $heading_level ne $Texinfo::Common::command_structuring_level{$cmdname}) {
+- $cmdname
+- = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
+- }
+- $result .= &{$self->{'format_heading_text'}}(
+- $self, $cmdname, $heading,
+- $heading_level +
+- $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
++ if ($self->in_preformatted()) {
++ $result .= $heading."\n";
++ } else {
++ if ($cmdname ne 'node'
++ and $heading_level ne $Texinfo::Common::command_structuring_level{$cmdname}) {
++ $cmdname
++ = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
+ }
++ if ($cmdname ne 'node') {
++ # Only add class if the command is not "node"
++ $result .= &{$self->formatting_function('format_heading_text')}(
++ $self, $cmdname, $heading,
++ $heading_level +
++ $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
++} else {
++ # Handle "Top" differently, without adding class
++ $result .= $heading . "\n";
++}
+ }
+- $result .= $content if (defined($content));
+- return $result;
++}
++$result .= $content if (defined($content));
++
++return $result;
+ }
+
+ foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
+@@ -127,22 +131,22 @@
+ }
+
+ # determine if texinfo is at least version 6.8
+-my $program_version_num = version->declare(get_conf('PACKAGE_VERSION'))->numify;
++my $program_version_num = version->declare(texinfo_get_conf('PACKAGE_VERSION'))->numify;
+ my $program_version_6_8 = $program_version_num >= 6.008000;
+
+ # print the TOC where @contents is used
+ if ($program_version_6_8) {
+- set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline');
++ texinfo_set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline');
+ } else {
+- set_from_init_file('INLINE_CONTENTS', 1);
++ texinfo_set_from_init_file('INLINE_CONTENTS', 1);
+ }
+
+ # make chapters <h2>
+-set_from_init_file('CHAPTER_HEADER_LEVEL', 2);
++texinfo_set_from_init_file('CHAPTER_HEADER_LEVEL', 2);
+
+ # Do not add <hr>
+-set_from_init_file('DEFAULT_RULE', '');
+-set_from_init_file('BIG_RULE', '');
++texinfo_set_from_init_file('DEFAULT_RULE', '');
++texinfo_set_from_init_file('BIG_RULE', '');
+
+ # Customized file beginning
+ sub ffmpeg_begin_file($$$)
+@@ -156,10 +160,10 @@
+ $command = $self->element_command($element);
+ }
+
+- my ($title, $description, $encoding, $date, $css_lines,
++my ($title, $description, $encoding, $date, $css_lines,
+ $doctype, $bodytext, $copying_comment, $after_body_open,
+ $extra_head, $program_and_version, $program_homepage,
+- $program, $generator) = $self->_file_header_informations($command);
++ $program, $generator) = $self->_file_header_information($command);
+
+ my $links = $self->_get_links ($filename, $element);
+
+@@ -201,13 +205,13 @@
+ sub ffmpeg_program_string($)
+ {
+ my $self = shift;
+- if (defined($self->get_conf('PROGRAM'))
+- and $self->get_conf('PROGRAM') ne ''
+- and defined($self->get_conf('PACKAGE_URL'))) {
++ if (defined($self->texinfo_get_conf('PROGRAM'))
++ and $self->texinfo_get_conf('PROGRAM') ne ''
++ and defined($self->texinfo_get_conf('PACKAGE_URL'))) {
+ return $self->convert_tree(
+ $self->gdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
+- { 'program_homepage' => $self->get_conf('PACKAGE_URL'),
+- 'program' => $self->get_conf('PROGRAM') }));
++ { 'program_homepage' => $self->texinfo_get_conf('PACKAGE_URL'),
++ 'program' => $self->texinfo_get_conf('PROGRAM') }));
+ } else {
+ return $self->convert_tree(
+ $self->gdt('This document was generated automatically.'));
+@@ -223,7 +227,7 @@
+ sub ffmpeg_end_file($)
+ {
+ my $self = shift;
+- my $program_string = &{$self->{'format_program_string'}}($self);
++ my $program_string = "This document was generated using TexinfoConverter.";
+ my $program_text = <<EOT;
+ <p style="font-size: small;">
+ $program_string
+@@ -244,7 +248,7 @@
+
+ # Dummy title command
+ # Ignore title. Title is handled through ffmpeg_begin_file().
+-set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1);
++texinfo_set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1);
+ sub ffmpeg_title($$$$)
+ {
+ return '';
+@@ -253,6 +257,8 @@
+ texinfo_register_command_formatting('titlefont',
+ \&ffmpeg_title);
+
++use lib '/usr/share/texinfo/Texinfo/Convert';
++
+ # Customized float command. Part of code borrowed from GNU Texinfo.
+ sub ffmpeg_float($$$$$)
+ {
+@@ -262,8 +268,9 @@
+ my $args = shift;
+ my $content = shift;
+
+- my ($caption, $prepended) = Texinfo::Common::float_name_caption($self,
++my ($caption, $prepended) = Texinfo::Convert::Converter::float_name_caption($self,
+ $command);
++
+ my $caption_text = '';
+ my $prepended_text;
+ my $prepended_save = '';
+@@ -335,24 +342,31 @@
+ $caption->{'args'}->[0], 'float caption');
+ }
+ if ($prepended_text.$caption_text ne '') {
+- $prepended_text = $self->_attribute_class('div','float-caption'). '>'
+- . $prepended_text;
++ $prepended_text = '<div class="float-caption">' . $prepended_text;
+ $caption_text .= '</div>';
++
+ }
+- my $html_class = '';
+- if ($prepended_save =~ /NOTE/) {
+- $html_class = 'info';
+- $prepended_text = '';
+- $caption_text = '';
+- } elsif ($prepended_save =~ /IMPORTANT/) {
+- $html_class = 'warning';
+- $prepended_text = '';
+- $caption_text = '';
+- }
+- return $self->_attribute_class('div', $html_class). '>' . "\n" .
+- $prepended_text . $caption_text . $content . '</div>';
+-}
++ my $html_class = [];
+
++if ($prepended_save =~ /NOTE/) {
++ $html_class = ['info'];
++ $prepended_text = '';
++ $caption_text = '';
++} elsif ($prepended_save =~ /IMPORTANT/) {
++ $html_class = ['warning'];
++ $prepended_text = '';
++ $caption_text = '';
++} elsif ($prepended_save =~ /Top/) {
++ $html_class = [grep { $_ ne 'Top' } @$html_class]; # Remove "Top" class
++ $prepended_text = '';
++ $caption_text = '';
++}
++
++# Set the class attribute directly in the HTML
++return $self->html_attribute_class('div', $html_class) . '>' . "\n" .
++ $prepended_text . $caption_text . $content . '</div>';
++
++}
+ texinfo_register_command_formatting('float',
+ \&ffmpeg_float);
+