commit:     8c66f04d366049d1c073b563126646fac97c4856
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 12 03:12:07 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 03:16:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c66f04d

dev-qt/qtmultimedia: backport minor fix for ffmpeg-6.1.2+

See patch comment, do not believe this is worth a revbump.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/qtmultimedia-6.7.2-ffmpeg-6.1.2.patch    | 42 ++++++++++++++++++++++
 dev-qt/qtmultimedia/qtmultimedia-6.7.2-r2.ebuild   |  1 +
 2 files changed, 43 insertions(+)

diff --git a/dev-qt/qtmultimedia/files/qtmultimedia-6.7.2-ffmpeg-6.1.2.patch 
b/dev-qt/qtmultimedia/files/qtmultimedia-6.7.2-ffmpeg-6.1.2.patch
new file mode 100644
index 000000000000..d364699fc401
--- /dev/null
+++ b/dev-qt/qtmultimedia/files/qtmultimedia-6.7.2-ffmpeg-6.1.2.patch
@@ -0,0 +1,42 @@
+Fix was for ffmpeg-7.0.1 (masked) but the change was backported to 6.1.2.
+
+Should hardly be an issue but it does cause a test failure when it
+attempts to compare the return error when reading a (intentionally)
+corrupted file (aborts either way, just differently). Still some time
+until 6.7.3, and prefer to keep tests in a working state meanwhile.
+
+https://bugreports.qt.io/browse/QTBUG-126687
+https://github.com/qt/qtmultimedia/commit/8d809d56697f8d23669a9b1476ac0b0748e32e0d
+From: Pavel Dubsky <[email protected]>
+Date: Wed, 10 Jul 2024 14:42:51 +0200
+Subject: [PATCH] Process FFmpeg AVERROR_INVALIDDATA from avformat_open_input
+
+FFmpeg version n7.0.1 changed the error code that is returned from
+function mp3_read_header: AVERROR(EINVAL) -> AVERROR_INVALIDDATA.
+
+Task-number: QTBUG-126687
+Pick-to: 6.8 6.7 6.5
+Change-Id: I6aee7771a9d1f80ea459376711d5264bed9a7bac
+Reviewed-by: Artem Dyomin <[email protected]>
+--- a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp
++++ b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegmediadataholder.cpp
+@@ -194,7 +194,7 @@ loadMedia(const QUrl &mediaUrl, QIODevice *stream, const 
std::shared_ptr<ICancel
+         auto code = QMediaPlayer::ResourceError;
+         if (ret == AVERROR(EACCES))
+             code = QMediaPlayer::AccessDeniedError;
+-        else if (ret == AVERROR(EINVAL))
++        else if (ret == AVERROR(EINVAL) || ret == AVERROR_INVALIDDATA)
+             code = QMediaPlayer::FormatError;
+ 
+         return MediaDataHolder::ContextError{ code, QMediaPlayer::tr("Could 
not open file") };
+--- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
++++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+@@ -962,7 +962,7 @@ void 
tst_QMediaPlayerBackend::setSource_emitsError_whenSdpFileIsLoaded()
+     });
+ 
+     m_fixture->player.setSource(sdpUrl);
+-    QTRY_COMPARE_EQ(m_fixture->player.error(), QMediaPlayer::ResourceError);
++    QTRY_COMPARE_EQ(m_fixture->player.error(), QMediaPlayer::FormatError);
+ #endif // QT_CONFIG(process)
+ }
+ 

diff --git a/dev-qt/qtmultimedia/qtmultimedia-6.7.2-r2.ebuild 
b/dev-qt/qtmultimedia/qtmultimedia-6.7.2-r2.ebuild
index 74869683aa32..75aefa2fa156 100644
--- a/dev-qt/qtmultimedia/qtmultimedia-6.7.2-r2.ebuild
+++ b/dev-qt/qtmultimedia/qtmultimedia-6.7.2-r2.ebuild
@@ -57,6 +57,7 @@ BDEPEND="~dev-qt/qtshadertools-${PV}:6"
 
 PATCHES=(
        "${FILESDIR}"/${P}-gstreamer-no-v4l.patch
+       "${FILESDIR}"/${P}-ffmpeg-6.1.2.patch
 )
 
 CMAKE_SKIP_TESTS=(

Reply via email to