commit: 45ccc27cec654c0208574125c333a6db9c3eeb75 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> AuthorDate: Tue Oct 21 09:30:32 2025 +0000 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> CommitDate: Tue Oct 21 10:10:00 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45ccc27c
media-video/ffmpegthumbnailer: add 2.2.3 bug #961947: add upstream fix which is not in this release, at a glance that fix requires >=ffmpeg-6.1 so adjust RDEPEND too (AV_FRAME_FLAG_INTERLACED was first added in 6.1, maybe final version will add guards but >=6.1 is a non-issue for us) bug #964772: problematic CMakeLists.txt was fixed, but still add QA skip given there is some (currently unused) ECM code paths that trigger benign <3.16 warnings bug #935072: according to comment in bug #962146, this bump should have fixed that but I haven't tested (feel free to re-open if needed) Also replace HAVE_PNG/JPEG by cmake_use given these are a hard set() and weren't respected (automagic). I originally wanted to just drop the USE altogether but didn't feel like bothering updating revdeps that depend on these. fwiw also enable by default regardless of profile as it doesn't make much sense to disable for a thumbnailer, this may prevent bad surprises if automagic was doign the work for some users before. Closes: https://bugs.gentoo.org/935072 Closes: https://bugs.gentoo.org/961947 Closes: https://bugs.gentoo.org/962146 Closes: https://bugs.gentoo.org/964772 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> media-video/ffmpegthumbnailer/Manifest | 1 + .../ffmpegthumbnailer-2.2.3.ebuild | 46 +++++++++++++++++++++ .../files/ffmpegthumbnailer-2.2.3-ffmpeg8.patch | 47 ++++++++++++++++++++++ 3 files changed, 94 insertions(+) diff --git a/media-video/ffmpegthumbnailer/Manifest b/media-video/ffmpegthumbnailer/Manifest index d17cf3f8bf1d..e817a3a274b0 100644 --- a/media-video/ffmpegthumbnailer/Manifest +++ b/media-video/ffmpegthumbnailer/Manifest @@ -1 +1,2 @@ DIST ffmpegthumbnailer-2.2.2.tar.bz2 1201838 BLAKE2B 449a876eaf56feb41c06dc5f3d123b138d66dfe8b6e1bc2e53f1742ef6fbd4ec5d14d77402e13cf8c369ee0cf0707ae5b100ac1d9fb02435b3c3a776cc9dc5f4 SHA512 52760dcf59430e5e85024c9f19dc1fac1d5f0edb4f937b33feac2b3ca8f12bbf549b5f658fc16fc07bf773717b9e10048aa3eb24bf52811c5c88c995ef492612 +DIST ffmpegthumbnailer-2.2.3.tar.gz 1291942 BLAKE2B d648183b58904ce947adc98f0f98c234dd79bbf269e8c72cc4aec22733639afb72f597ecf9c3fbf9045eeb3c0a9fba62fd826016f8ac91bf95f44372e8e11883 SHA512 b1299c5ea8ae11ab5dd34bfe74d0b117fcd842f9a41e542120cfcb2faaf7a84f5253eb86951095df9afd7912a0faa921fe0274322cf500b9aed38de366751523 diff --git a/media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.2.3.ebuild b/media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.2.3.ebuild new file mode 100644 index 000000000000..1178ee0008cc --- /dev/null +++ b/media-video/ffmpegthumbnailer/ffmpegthumbnailer-2.2.3.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="Lightweight video thumbnailer that can be used by file managers" +HOMEPAGE="https://github.com/dirkvdb/ffmpegthumbnailer/" +SRC_URI=" + https://github.com/dirkvdb/ffmpegthumbnailer/archive/refs/tags/${PV}.tar.gz + -> ${P}.tar.gz +" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="gtk +jpeg +png test" +RESTRICT="!test? ( test )" +REQUIRED_USE="test? ( png jpeg )" + +RDEPEND=" + >=media-video/ffmpeg-6.1:= + gtk? ( dev-libs/glib:2 ) + jpeg? ( media-libs/libjpeg-turbo:= ) + png? ( media-libs/libpng:= ) +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-ffmpeg8.patch +) + +CMAKE_QA_COMPAT_SKIP=1 + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package jpeg JPEG) + $(cmake_use_find_package png PNG) + -DENABLE_GIO=$(usex gtk) + -DENABLE_TESTS=$(usex test) + -DENABLE_THUMBNAILER=ON + ) + + cmake_src_configure +} diff --git a/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.2.3-ffmpeg8.patch b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.2.3-ffmpeg8.patch new file mode 100644 index 000000000000..5ac711157ae0 --- /dev/null +++ b/media-video/ffmpegthumbnailer/files/ffmpegthumbnailer-2.2.3-ffmpeg8.patch @@ -0,0 +1,47 @@ +https://bugs.gentoo.org/961947 +https://github.com/dirkvdb/ffmpegthumbnailer/pull/240 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -408,3 +408,3 @@ + AVFilterContext* yadifFilter = nullptr; +- if (m_pFrame->interlaced_frame != 0) ++ if (m_pFrame->flags & AV_FRAME_FLAG_INTERLACED) + { +@@ -520,3 +520,3 @@ + ++keyFrameAttempts; +- } while ((!gotFrame || !m_pFrame->key_frame) && keyFrameAttempts < 200); ++ } while ((!gotFrame || !(m_pFrame->flags & AV_FRAME_FLAG_KEY)) && keyFrameAttempts < 200); + +@@ -657,16 +657,23 @@ + { +- auto matrix = reinterpret_cast<int32_t*>(av_stream_get_side_data(m_pVideoStream, AV_PKT_DATA_DISPLAYMATRIX, nullptr)); +- if (matrix) +- { ++ if (!m_pVideoStream || !m_pVideoStream->codecpar) { ++ return -1; ++ } ++ ++ // For FFmpeg 5.0+ ++ const AVPacketSideData* side_data = av_packet_side_data_get( ++ m_pVideoStream->codecpar->coded_side_data, ++ m_pVideoStream->codecpar->nb_coded_side_data, ++ AV_PKT_DATA_DISPLAYMATRIX ++ ); ++ ++ if (side_data && side_data->size >= sizeof(int32_t) * 9) { ++ const int32_t* matrix = reinterpret_cast<const int32_t*>(side_data->data); + auto angle = lround(av_display_rotation_get(matrix)); +- if (angle < -135) +- { ++ if (angle < -135) { + return 3; + } +- else if (angle > 45 && angle < 135) +- { ++ else if (angle > 45 && angle < 135) { + return 2; + } +- else if (angle < -45 && angle > -135) +- { ++ else if (angle < -45 && angle > -135) { + return 1;
