diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2022-10-10 18:45:33 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2022-10-11 07:00:35 +0200 |
commit | 1af8dbc03d5185cb3d39c77677adbddadf86a05a (patch) | |
tree | c2509e377966d85492664291169635fdad65187f /source/xap/ffmpegthumbnailer | |
parent | be4ce9e049b2e9e456da6a279d08ededc705b936 (diff) | |
download | current-1af8dbc03d5185cb3d39c77677adbddadf86a05a.tar.gz current-1af8dbc03d5185cb3d39c77677adbddadf86a05a.tar.xz |
Mon Oct 10 18:45:33 UTC 202220221010184533
ap/diffstat-1.65-x86_64-1.txz: Upgraded.
ap/moc-2.6_alpha3-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
kde/attica-5.99.0-x86_64-1.txz: Upgraded.
kde/baloo-5.99.0-x86_64-1.txz: Upgraded.
kde/bluez-qt-5.99.0-x86_64-1.txz: Upgraded.
kde/breeze-icons-5.99.0-noarch-1.txz: Upgraded.
kde/digikam-7.8.0-x86_64-3.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
kde/extra-cmake-modules-5.99.0-x86_64-1.txz: Upgraded.
kde/ffmpegthumbs-22.08.1-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
kde/frameworkintegration-5.99.0-x86_64-1.txz: Upgraded.
kde/kactivities-5.99.0-x86_64-1.txz: Upgraded.
kde/kactivities-stats-5.99.0-x86_64-1.txz: Upgraded.
kde/kapidox-5.99.0-x86_64-1.txz: Upgraded.
kde/karchive-5.99.0-x86_64-1.txz: Upgraded.
kde/kauth-5.99.0-x86_64-1.txz: Upgraded.
kde/kbookmarks-5.99.0-x86_64-1.txz: Upgraded.
kde/kcalendarcore-5.99.0-x86_64-1.txz: Upgraded.
kde/kcmutils-5.99.0-x86_64-1.txz: Upgraded.
kde/kcodecs-5.99.0-x86_64-1.txz: Upgraded.
kde/kcompletion-5.99.0-x86_64-1.txz: Upgraded.
kde/kconfig-5.99.0-x86_64-1.txz: Upgraded.
kde/kconfigwidgets-5.99.0-x86_64-1.txz: Upgraded.
kde/kcontacts-5.99.0-x86_64-1.txz: Upgraded.
kde/kcoreaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kcrash-5.99.0-x86_64-1.txz: Upgraded.
kde/kdav-5.99.0-x86_64-1.txz: Upgraded.
kde/kdbusaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kdeclarative-5.99.0-x86_64-1.txz: Upgraded.
kde/kded-5.99.0-x86_64-1.txz: Upgraded.
kde/kdelibs4support-5.99.0-x86_64-1.txz: Upgraded.
kde/kdesignerplugin-5.99.0-x86_64-1.txz: Upgraded.
kde/kdesu-5.99.0-x86_64-1.txz: Upgraded.
kde/kdewebkit-5.99.0-x86_64-1.txz: Upgraded.
kde/kdnssd-5.99.0-x86_64-1.txz: Upgraded.
kde/kdoctools-5.99.0-x86_64-1.txz: Upgraded.
kde/kemoticons-5.99.0-x86_64-1.txz: Upgraded.
kde/kfilemetadata-5.99.0-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
kde/kglobalaccel-5.99.0-x86_64-1.txz: Upgraded.
kde/kguiaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kholidays-5.99.0-x86_64-1.txz: Upgraded.
kde/khtml-5.99.0-x86_64-1.txz: Upgraded.
kde/ki18n-5.99.0-x86_64-1.txz: Upgraded.
kde/kiconthemes-5.99.0-x86_64-1.txz: Upgraded.
kde/kidletime-5.99.0-x86_64-1.txz: Upgraded.
kde/kimageformats-5.99.0-x86_64-1.txz: Upgraded.
kde/kinit-5.99.0-x86_64-1.txz: Upgraded.
kde/kio-5.99.0-x86_64-1.txz: Upgraded.
kde/kirigami2-5.99.0-x86_64-1.txz: Upgraded.
kde/kitemmodels-5.99.0-x86_64-1.txz: Upgraded.
kde/kitemviews-5.99.0-x86_64-1.txz: Upgraded.
kde/kjobwidgets-5.99.0-x86_64-1.txz: Upgraded.
kde/kjs-5.99.0-x86_64-1.txz: Upgraded.
kde/kjsembed-5.99.0-x86_64-1.txz: Upgraded.
kde/kmediaplayer-5.99.0-x86_64-1.txz: Upgraded.
kde/knewstuff-5.99.0-x86_64-1.txz: Upgraded.
kde/knotifications-5.99.0-x86_64-1.txz: Upgraded.
kde/knotifyconfig-5.99.0-x86_64-1.txz: Upgraded.
kde/kpackage-5.99.0-x86_64-1.txz: Upgraded.
kde/kparts-5.99.0-x86_64-1.txz: Upgraded.
kde/kpeople-5.99.0-x86_64-1.txz: Upgraded.
kde/kplotting-5.99.0-x86_64-1.txz: Upgraded.
kde/kpty-5.99.0-x86_64-1.txz: Upgraded.
kde/kquickcharts-5.99.0-x86_64-1.txz: Upgraded.
kde/kross-5.99.0-x86_64-1.txz: Upgraded.
kde/krunner-5.99.0-x86_64-1.txz: Upgraded.
kde/kservice-5.99.0-x86_64-1.txz: Upgraded.
kde/ktexteditor-5.99.0-x86_64-1.txz: Upgraded.
kde/ktextwidgets-5.99.0-x86_64-1.txz: Upgraded.
kde/kunitconversion-5.99.0-x86_64-1.txz: Upgraded.
kde/kwallet-5.99.0-x86_64-1.txz: Upgraded.
kde/kwayland-5.99.0-x86_64-1.txz: Upgraded.
kde/kwidgetsaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kwindowsystem-5.99.0-x86_64-1.txz: Upgraded.
kde/kxmlgui-5.99.0-x86_64-1.txz: Upgraded.
kde/kxmlrpcclient-5.99.0-x86_64-1.txz: Upgraded.
kde/modemmanager-qt-5.99.0-x86_64-1.txz: Upgraded.
kde/networkmanager-qt-5.99.0-x86_64-1.txz: Upgraded.
kde/oxygen-icons5-5.99.0-noarch-1.txz: Upgraded.
kde/plasma-framework-5.99.0-x86_64-1.txz: Upgraded.
kde/prison-5.99.0-x86_64-1.txz: Upgraded.
kde/purpose-5.99.0-x86_64-1.txz: Upgraded.
kde/qqc2-desktop-style-5.99.0-x86_64-1.txz: Upgraded.
kde/solid-5.99.0-x86_64-1.txz: Upgraded.
kde/sonnet-5.99.0-x86_64-1.txz: Upgraded.
kde/syndication-5.99.0-x86_64-1.txz: Upgraded.
kde/syntax-highlighting-5.99.0-x86_64-1.txz: Upgraded.
kde/threadweaver-5.99.0-x86_64-1.txz: Upgraded.
l/QtAV-20220226_fdc613dc-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
l/alsa-plugins-1.2.7.1-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/ffmpeg-5.1.2-x86_64-1.txz: Upgraded.
Shared library .so-version bump.
Enabled glslang and vulkan. Thanks to Heinz Wiesinger.
l/gegl-0.4.38-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/gst-plugins-libav-1.20.3-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/harfbuzz-5.3.0-x86_64-1.txz: Upgraded.
l/imagemagick-7.1.0_50-x86_64-1.txz: Upgraded.
l/libvncserver-0.9.13-x86_64-4.txz: Rebuilt.
Disabled ffmpeg support (not compatible with ffmpeg5).
l/mlt-7.8.0-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/opencv-4.6.0-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/pcre2-10.40-x86_64-2.txz: Rebuilt.
Moved shared libraries into /lib${LIBDIRSUFFIX}. Thanks to TommyC7.
l/pipewire-0.3.59-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/qt5-5.15.6_20220928_06b700dd-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
n/libgpg-error-1.46-x86_64-2.txz: Rebuilt.
Rebuilt with --enable-install-gpg-error-config to fix regression building
gpgme. Thanks to nobodino and ponce.
x/libva-utils-2.16.0-x86_64-1.txz: Upgraded.
x/wayland-protocols-1.27-noarch-1.txz: Upgraded.
xap/MPlayer-20221009-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
xap/audacious-plugins-4.2-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
xap/ffmpegthumbnailer-2.2.2-x86_64-4.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
xap/freerdp-2.8.0-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
xap/ssr-0.4.4-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
xap/xine-lib-1.2.12-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
Diffstat (limited to 'source/xap/ffmpegthumbnailer')
-rw-r--r-- | source/xap/ffmpegthumbnailer/198.patch | 320 | ||||
-rw-r--r-- | source/xap/ffmpegthumbnailer/efb5b618.patch | 22 | ||||
-rwxr-xr-x | source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild | 12 |
3 files changed, 350 insertions, 4 deletions
diff --git a/source/xap/ffmpegthumbnailer/198.patch b/source/xap/ffmpegthumbnailer/198.patch new file mode 100644 index 000000000..25a4a5f0c --- /dev/null +++ b/source/xap/ffmpegthumbnailer/198.patch @@ -0,0 +1,320 @@ +From 67be4abd22b726e277c4b67bfb3abf5a65cfd9b5 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:23:23 +1000 +Subject: [PATCH 1/9] lib/moviedecoder: remove unused variable + +--- + libffmpegthumbnailer/moviedecoder.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 290e212..aa44adf 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -570,8 +570,6 @@ bool MovieDecoder::getVideoPacket() + bool framesAvailable = true; + bool frameDecoded = false; + +- int attempts = 0; +- + if (m_pPacket) + { + av_packet_unref(m_pPacket); + +From 66f64668e7a063e790813c7733ca438ab112af89 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:42:07 +1000 +Subject: [PATCH 2/9] lib/moviedecoder: clang-tidy fixes + +--- + libffmpegthumbnailer/moviedecoder.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index aa44adf..79c950b 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -503,12 +503,12 @@ void MovieDecoder::seek(int timeInSeconds) + avcodec_flush_buffers(m_pFormatContext->streams[m_VideoStream]->codec); + + int keyFrameAttempts = 0; +- bool gotFrame = 0; ++ bool gotFrame; + + do + { + int count = 0; +- gotFrame = 0; ++ gotFrame = false; + + while (!gotFrame && count < 20) + { + +From 96c22aa66719846854895afcb72962862d5a4ffd Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 20:39:32 +1000 +Subject: [PATCH 3/9] lib/moviedecoder: remove SilenceLogLevel + +Was unused. +--- + libffmpegthumbnailer/moviedecoder.cpp | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 79c950b..21df096 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -41,11 +41,6 @@ using namespace std; + namespace ffmpegthumbnailer + { + +-struct SilenceLogLevel +-{ +- SilenceLogLevel() { av_log_set_level(AV_LOG_QUIET); } +-}; +- + MovieDecoder::MovieDecoder(AVFormatContext* pavContext) + : m_VideoStream(-1) + , m_pFormatContext(pavContext) + +From 664680f4bfeb89923f485eba270f9e49a8d02bfc Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:25:40 +1000 +Subject: [PATCH 4/9] lib/moviedecoder: remove registration calls + +They're not needed anymore. +--- + libffmpegthumbnailer/moviedecoder.cpp | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 21df096..ac3e5b9 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -65,8 +65,6 @@ MovieDecoder::~MovieDecoder() + + void MovieDecoder::initialize(const string& filename, bool preferEmbeddedMetadata) + { +- av_register_all(); +- avcodec_register_all(); + avformat_network_init(); + + string inputFile = filename == "-" ? "pipe:" : filename; +@@ -386,8 +384,6 @@ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std:: + auto del = [] (AVBufferSinkParams* p) { av_freep(p); }; + std::unique_ptr<AVBufferSinkParams, decltype(del)> buffersinkParams(av_buffersink_params_alloc(), del); + +- avfilter_register_all(); +- + m_pFilterGraph = avfilter_graph_alloc(); + assert(m_pFilterGraph); + + +From 1ae42e664e1f3c915d186ae00aa2c8018b998708 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:30:21 +1000 +Subject: [PATCH 5/9] lib/moviedecoder: remove use of AVBufferSinkParams + +--- + libffmpegthumbnailer/moviedecoder.cpp | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index ac3e5b9..dece668 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -379,11 +379,6 @@ std::string MovieDecoder::createScaleString(const std::string& sizeString, bool + + void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std::string& size, bool maintainAspectRatio) + { +- static const AVPixelFormat pixelFormats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }; +- +- auto del = [] (AVBufferSinkParams* p) { av_freep(p); }; +- std::unique_ptr<AVBufferSinkParams, decltype(del)> buffersinkParams(av_buffersink_params_alloc(), del); +- + m_pFilterGraph = avfilter_graph_alloc(); + assert(m_pFilterGraph); + +@@ -395,10 +390,8 @@ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std:: + + checkRc(avfilter_graph_create_filter(&m_pFilterSource, avfilter_get_by_name("buffer"), "thumb_buffer", ss.str().c_str(), nullptr, m_pFilterGraph), + "Failed to create filter source"); +- buffersinkParams->pixel_fmts = pixelFormats; +- checkRc(avfilter_graph_create_filter(&m_pFilterSink, avfilter_get_by_name("buffersink"), "thumb_buffersink", nullptr, buffersinkParams.get(), m_pFilterGraph), ++ checkRc(avfilter_graph_create_filter(&m_pFilterSink, avfilter_get_by_name("buffersink"), "thumb_buffersink", nullptr, nullptr, m_pFilterGraph), + "Failed to create filter sink"); +- buffersinkParams.release(); + + AVFilterContext* yadifFilter = nullptr; + if (m_pFrame->interlaced_frame != 0) + +From 19675349662a4ea4455d7d13b01cca28ab585762 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:39:58 +1000 +Subject: [PATCH 6/9] lib/moviedecoder: use m_pVideoCodecContext instead of + AVStream::codec + +--- + libffmpegthumbnailer/moviedecoder.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index dece668..0b7a280 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -484,7 +484,7 @@ void MovieDecoder::seek(int timeInSeconds) + } + + checkRc(av_seek_frame(m_pFormatContext, -1, timestamp, 0), "Seeking in video failed"); +- avcodec_flush_buffers(m_pFormatContext->streams[m_VideoStream]->codec); ++ avcodec_flush_buffers(m_pVideoCodecContext); + + int keyFrameAttempts = 0; + bool gotFrame; + +From 4f74f83a009fa2b3f3d546adb24d4f1406910007 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:49:03 +1000 +Subject: [PATCH 7/9] lib/moviedecoder: codec -> codecpar + +--- + libffmpegthumbnailer/moviedecoder.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 0b7a280..e58904e 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -145,10 +145,10 @@ int32_t MovieDecoder::findPreferedVideoStream(bool preferEmbeddedMetadata) + for (unsigned int i = 0; i < m_pFormatContext->nb_streams; ++i) + { + AVStream *stream = m_pFormatContext->streams[i]; +- auto ctx = m_pFormatContext->streams[i]->codec; +- if (ctx->codec_type == AVMEDIA_TYPE_VIDEO) ++ auto par = m_pFormatContext->streams[i]->codecpar; ++ if (par->codec_type == AVMEDIA_TYPE_VIDEO) + { +- if (!preferEmbeddedMetadata || !isStillImageCodec(ctx->codec_id)) ++ if (!preferEmbeddedMetadata || !isStillImageCodec(par->codec_id)) + { + videoStreams.push_back(i); + continue; + +From 3ffdd65cbda6ef21d36c96013db1b0f4dc9fc57b Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:52:01 +1000 +Subject: [PATCH 8/9] lib/movedecoder: don't rely on avformat to allocate a + context + +--- + libffmpegthumbnailer/moviedecoder.cpp | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index e58904e..da5f32a 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -90,8 +90,7 @@ void MovieDecoder::destroy() + { + if (m_pVideoCodecContext) + { +- avcodec_close(m_pVideoCodecContext); +- m_pVideoCodecContext = nullptr; ++ avcodec_free_context(&m_pVideoCodecContext); + } + + if ((!m_FormatContextWasGiven) && m_pFormatContext) +@@ -196,8 +195,7 @@ void MovieDecoder::initializeVideo(bool preferEmbeddedMetadata) + } + + m_pVideoStream = m_pFormatContext->streams[m_VideoStream]; +- m_pVideoCodecContext = m_pVideoStream->codec; +- m_pVideoCodec = avcodec_find_decoder(m_pVideoCodecContext->codec_id); ++ m_pVideoCodec = avcodec_find_decoder(m_pVideoStream->codecpar->codec_id); + + if (m_pVideoCodec == nullptr) + { +@@ -207,6 +205,20 @@ void MovieDecoder::initializeVideo(bool preferEmbeddedMetadata) + throw logic_error("Video Codec not found"); + } + ++ m_pVideoCodecContext = avcodec_alloc_context3(m_pVideoCodec); ++ ++ if (m_pVideoCodecContext == nullptr) ++ { ++ destroy(); ++ throw logic_error("Could not allocate video codec context"); ++ } ++ ++ if (avcodec_parameters_to_context(m_pVideoCodecContext, m_pVideoStream->codecpar) < 0) ++ { ++ destroy(); ++ throw logic_error("Could not configure video codec context"); ++ } ++ + m_pVideoCodecContext->workaround_bugs = 1; + + if (avcodec_open2(m_pVideoCodecContext, m_pVideoCodec, nullptr) < 0) + +From f9273852c8e3d7af77d6c8929b1ac6c8a26eca50 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 20:57:45 +1000 +Subject: [PATCH 9/9] lib/moviedecoder: replace avcodec_decode_video2() usage + +--- + libffmpegthumbnailer/moviedecoder.cpp | 31 +++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 7 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index da5f32a..f32577a 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -548,17 +548,33 @@ bool MovieDecoder::decodeVideoPacket() + return false; + } + +- av_frame_unref(m_pFrame); +- +- int frameFinished; ++ int rc = avcodec_send_packet(m_pVideoCodecContext, m_pPacket); ++ if(rc == AVERROR(EAGAIN)) ++ { ++ rc = 0; ++ } + +- int bytesDecoded = avcodec_decode_video2(m_pVideoCodecContext, m_pFrame, &frameFinished, m_pPacket); +- if (bytesDecoded < 0) ++ if(rc == AVERROR_EOF) ++ { ++ return false; ++ } ++ else if(rc < 0) + { +- throw logic_error("Failed to decode video frame: bytesDecoded < 0"); ++ throw logic_error("Failed to decode video frame: avcodec_send_packet() < 0"); + } + +- return frameFinished > 0; ++ rc = avcodec_receive_frame(m_pVideoCodecContext, m_pFrame); ++ switch(rc) ++ { ++ case 0: ++ return true; ++ ++ case AVERROR(EAGAIN): ++ return false; ++ ++ default: ++ throw logic_error("Failed to decode video frame: avcodec_receive_frame() < 0"); ++ } + } + + bool MovieDecoder::getVideoPacket() +@@ -574,6 +590,7 @@ bool MovieDecoder::getVideoPacket() + + m_pPacket = new AVPacket(); + ++ + while (framesAvailable && !frameDecoded) + { + framesAvailable = av_read_frame(m_pFormatContext, m_pPacket) >= 0; diff --git a/source/xap/ffmpegthumbnailer/efb5b618.patch b/source/xap/ffmpegthumbnailer/efb5b618.patch new file mode 100644 index 000000000..81e57aab1 --- /dev/null +++ b/source/xap/ffmpegthumbnailer/efb5b618.patch @@ -0,0 +1,22 @@ +From efb5b618f1c1471c1a7900aed3a59d851ea9a210 Mon Sep 17 00:00:00 2001 +From: Paul Jonkins <paul.ionkin@gmail.com> +Date: Wed, 23 Jun 2021 17:53:55 +0200 +Subject: [PATCH] Constify AVCodec + +--- + libffmpegthumbnailer/moviedecoder.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.h b/libffmpegthumbnailer/moviedecoder.h +index 3ef5f12..fb6add2 100644 +--- a/libffmpegthumbnailer/moviedecoder.h ++++ b/libffmpegthumbnailer/moviedecoder.h +@@ -78,7 +78,7 @@ class MovieDecoder + int m_VideoStream;
+ AVFormatContext* m_pFormatContext;
+ AVCodecContext* m_pVideoCodecContext;
+- AVCodec* m_pVideoCodec;
++ const AVCodec* m_pVideoCodec;
+ AVFilterGraph* m_pFilterGraph;
+ AVFilterContext* m_pFilterSource;
+ AVFilterContext* m_pFilterSink;
diff --git a/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild b/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild index b590ee79e..bc46b59cc 100755 --- a/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild +++ b/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild @@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=ffmpegthumbnailer VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-3} +BUILD=${BUILD:-4} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -87,6 +87,10 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Fix build with ffmpeg-5: +zcat $CWD/198.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/efb5b618.patch.gz | patch -p1 --verbose || exit 1 + # Configure, build, and install: mkdir cmake-build cd cmake-build @@ -98,10 +102,10 @@ cd cmake-build -DCMAKE_INSTALL_MANDIR="man" \ -DENABLE_GIO="yes" \ -DENABLE_THUMBNAILER="yes" \ - .. + .. || exit 1 - make VERBOSE=1 - make install DESTDIR=$PKG + make VERBOSE=1 || exit 1 + make install DESTDIR=$PKG || exit 1 cd .. # Strip binaries: |