summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2023-07-25 14:34:22 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2023-07-25 14:34:22 +0200
commita5539b941812b7f16e54e588eff7dfb7d4305063 (patch)
tree3b01c77c0941ac964c60a027b072509119a06046 /media-video/subtitlecomposer
parentkde-frameworks/bluez-qt: Add back VIRTUALX_REQUIRED, otherwise hangs (diff)
downloadgentoo-a5539b941812b7f16e54e588eff7dfb7d4305063.tar.gz
gentoo-a5539b941812b7f16e54e588eff7dfb7d4305063.tar.bz2
gentoo-a5539b941812b7f16e54e588eff7dfb7d4305063.zip
media-video/subtitlecomposer: Fix build and runtime with >=ffmpeg-6
Upstream commits: 12f4d7f49d0b1a7fc02b0836521a285e7b6bac9d 0bb0e6ed99d5a4200cc89fc6e8b3013c70465402 Closes: https://bugs.gentoo.org/910048 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-video/subtitlecomposer')
-rw-r--r--media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-1.patch25
-rw-r--r--media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-2.patch42
-rw-r--r--media-video/subtitlecomposer/subtitlecomposer-0.7.1-r2.ebuild62
3 files changed, 129 insertions, 0 deletions
diff --git a/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-1.patch b/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-1.patch
new file mode 100644
index 000000000000..7e0d873992a5
--- /dev/null
+++ b/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-1.patch
@@ -0,0 +1,25 @@
+From 12f4d7f49d0b1a7fc02b0836521a285e7b6bac9d Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Sat, 4 Mar 2023 10:58:04 +0100
+Subject: [PATCH] Use non deprecated ffmpeg api
+
+---
+ src/videoplayer/backend/streamdemuxer.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/videoplayer/backend/streamdemuxer.cpp b/src/videoplayer/backend/streamdemuxer.cpp
+index e3bd808a..39222d8c 100644
+--- a/src/videoplayer/backend/streamdemuxer.cpp
++++ b/src/videoplayer/backend/streamdemuxer.cpp
+@@ -504,7 +504,7 @@ StreamDemuxer::run()
+
+ { // find_stream_info
+ const int origNbStreams = ic->nb_streams;
+- AVDictionary **opts = (AVDictionary **)av_mallocz_array(origNbStreams, sizeof(*opts));
++ AVDictionary **opts = (AVDictionary **)av_calloc(origNbStreams, sizeof(*opts));
+ if(!opts) {
+ av_log(nullptr, AV_LOG_ERROR, "Could not alloc memory for stream options.\n");
+ goto cleanup;
+--
+GitLab
+
diff --git a/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-2.patch b/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-2.patch
new file mode 100644
index 000000000000..58c3e9d9dfd3
--- /dev/null
+++ b/media-video/subtitlecomposer/files/subtitlecomposer-0.7.1-ffmpeg6-2.patch
@@ -0,0 +1,42 @@
+From 0bb0e6ed99d5a4200cc89fc6e8b3013c70465402 Mon Sep 17 00:00:00 2001
+From: Mladen Milinkovic <maxrd2@smoothware.net>
+Date: Mon, 5 Jun 2023 10:13:15 +0200
+Subject: [PATCH] StreamProcessor: fixed embedded ASS decoding
+
+Seems embeded ASS subtitle format got changed in FFmpeg 6. Haven't found
+any references to it tho, so this might still be borked in some cases.
+---
+ src/streamprocessor/streamprocessor.cpp | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/src/streamprocessor/streamprocessor.cpp b/src/streamprocessor/streamprocessor.cpp
+index b759b0d3..1e883780 100644
+--- a/src/streamprocessor/streamprocessor.cpp
++++ b/src/streamprocessor/streamprocessor.cpp
+@@ -537,11 +537,10 @@ StreamProcessor::processText()
+ case SUBTITLE_ASS: {
+ #if 1
+ const char *assText = sub->ass;
+- if(strncmp("Dialogue", assText, 8) != 0)
+- break;
+-
++ // FIXME: did ass format change with ffmpeg6? can't find any references
++ const int textLocation = strncmp("Dialogue", assText, 8) ? 8 : 9;
+ // Dialogue: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
+- for(int c = 9; c && *assText; assText++) {
++ for(int c = textLocation; c && *assText; assText++) {
+ if(*assText == ',')
+ c--;
+ }
+@@ -550,7 +549,7 @@ StreamProcessor::processText()
+ "{\\c&H0000ff&}red {\\c&H00ff00&}green {\\c&Hff0000&}blue{\\r}\\n"
+ "Another {\\b100}bold\\h{\\i1}bolditalic{\\b0\\i0} some{\\anidfsd} unsupported tag";
+ #endif
+- QString assChunk(assText);
++ QString assChunk = QString::fromUtf8(assText);
+
+ assChunk
+ .replace(QStringLiteral("\\N"), QStringLiteral("\n"))
+--
+GitLab
+
diff --git a/media-video/subtitlecomposer/subtitlecomposer-0.7.1-r2.ebuild b/media-video/subtitlecomposer/subtitlecomposer-0.7.1-r2.ebuild
new file mode 100644
index 000000000000..84b4fcd68249
--- /dev/null
+++ b/media-video/subtitlecomposer/subtitlecomposer-0.7.1-r2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_TEST="forceoptional"
+KFMIN=5.106.0
+QTMIN=5.15.9
+inherit ecm kde.org
+
+DESCRIPTION="Text-based subtitles editor"
+HOMEPAGE="https://subtitlecomposer.kde.org/"
+PATCHSET="${P}-patchset-1"
+SRC_URI="mirror://kde/stable/${PN}/${P}.tar.xz
+ https://dev.gentoo.org/~asturm/distfiles/${PATCHSET}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="5"
+KEYWORDS="~amd64 ~x86"
+IUSE="unicode"
+
+DEPEND="
+ >=dev-qt/qtdeclarative-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=kde-frameworks/kcodecs-${KFMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/ktextwidgets-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ >=kde-frameworks/sonnet-${KFMIN}:5
+ media-libs/openal
+ media-video/ffmpeg:0=
+ unicode? ( dev-libs/icu:= )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${WORKDIR}/${PATCHSET}/${P}-tests-optional.patch"
+ "${WORKDIR}/${PATCHSET}/${P}-gles-support.patch" # bug 820035
+ "${WORKDIR}/${PATCHSET}/${P}-ffmpeg-5.patch" # bug 834416
+ "${WORKDIR}/${PATCHSET}/${P}-replace-kross-w-qjsengine.patch" # bug 755956
+ "${FILESDIR}"/${P}-ffmpeg6-{1,2}.patch # bug 910048
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_PocketSphinx=ON # bug 616706
+ $(cmake_use_find_package unicode ICU)
+ )
+
+ ecm_src_configure
+}