[arch-commits] Commit in aegisub/repos (8 files)

Felix Yan felixonmars at gemini.archlinux.org
Mon Nov 22 00:28:53 UTC 2021


    Date: Monday, November 22, 2021 @ 00:28:53
  Author: felixonmars
Revision: 1054125

archrelease: copy trunk to community-staging-x86_64

Added:
  aegisub/repos/community-staging-x86_64/
  aegisub/repos/community-staging-x86_64/PKGBUILD
    (from rev 1054124, aegisub/trunk/PKGBUILD)
  aegisub/repos/community-staging-x86_64/boost-1.68.patch
    (from rev 1054124, aegisub/trunk/boost-1.68.patch)
  aegisub/repos/community-staging-x86_64/fix-ffms2-compat-2.patch
    (from rev 1054124, aegisub/trunk/fix-ffms2-compat-2.patch)
  aegisub/repos/community-staging-x86_64/fix-ffms2-compat-3.patch
    (from rev 1054124, aegisub/trunk/fix-ffms2-compat-3.patch)
  aegisub/repos/community-staging-x86_64/fix-ffms2-compat.patch
    (from rev 1054124, aegisub/trunk/fix-ffms2-compat.patch)
  aegisub/repos/community-staging-x86_64/icu59.patch
    (from rev 1054124, aegisub/trunk/icu59.patch)
  aegisub/repos/community-staging-x86_64/make-4.3.patch
    (from rev 1054124, aegisub/trunk/make-4.3.patch)

--------------------------+
 PKGBUILD                 |   97 ++++++++++++++++
 boost-1.68.patch         |   34 +++++
 fix-ffms2-compat-2.patch |   23 ++++
 fix-ffms2-compat-3.patch |  106 ++++++++++++++++++
 fix-ffms2-compat.patch   |  257 +++++++++++++++++++++++++++++++++++++++++++++
 icu59.patch              |   11 +
 make-4.3.patch           |   23 ++++
 7 files changed, 551 insertions(+)

Copied: aegisub/repos/community-staging-x86_64/PKGBUILD (from rev 1054124, aegisub/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,97 @@
+# Maintainer: Maxime Gauduin <alucryd at archlinux.org>
+# Contributor: kozec <kozec at kozec.com>
+# Contributor: Limao Luo <luolimao+AUR at gmail.com>
+
+pkgname=aegisub
+pkgver=3.2.2
+pkgrel=47
+pkgdesc='A general-purpose subtitle editor with ASS/SSA support'
+arch=(x86_64)
+url=http://www.aegisub.org
+license=(
+  GPL
+  BSD
+)
+depends=(
+  alsa-lib
+  boost-libs
+  fftw
+  fontconfig
+  hunspell
+  icu
+  libass.so
+  libffms2.so
+  libgl
+  libpulse
+  wxgtk3
+  zlib
+)
+makedepends=(
+  boost
+  git
+  intltool
+  mesa
+)
+source=(
+  git+https://github.com/Aegisub/Aegisub.git?signed#tag=v${pkgver}
+  boost-1.68.patch
+  icu59.patch
+  make-4.3.patch
+  fix-ffms2-compat.patch
+  fix-ffms2-compat-2.patch
+  fix-ffms2-compat-3.patch
+)
+validpgpkeys=(6DD9508BCB1CE31AF295FF9B6A889F50A8B00C08) # Thomas Goyne <plorkyeran at aegisub.org>
+sha256sums=('SKIP'
+            'aa1689a2204f6a617000f3380b8dea9c3dca4f500d0643e05172750c49cc5a21'
+            '29d8cc91e73602d5e3c8517c977dcc77cb84af7d42787f510d487d0a6abf7fa6'
+            '1e350a04c152075b369176f8e0b7f691a792de0d5091568e2388e6bd677180e1'
+            '1361e782a19d1e6cdd0dabe0a5e7dedd3d750ea5c18884eee807c70637811fad'
+            'c5753b989896d1f29722fbf748a2177ffd2d73538020bedaadbf3bca73a3c6d7'
+            '301ee822a01bad9004c8cab4e96d8bf3fe378a31956c0bd784e0bc245de57c5c')
+
+prepare() {
+  cd Aegisub
+
+  patch -Np1 -i ../boost-1.68.patch
+  sed 's|gil/gil_all.hpp|gil.hpp|g' -i src/*.cpp # boost 1.69
+  sed 's/$(LIBS_BOOST) $(LIBS_ICU)/$(LIBS_BOOST) $(LIBS_ICU) -pthread/' -i tools/Makefile # missing link flag
+  sed 's/^Exec=/Exec=env GDK_BACKEND=x11 /' -i packages/desktop/aegisub.desktop.template.in # fix running under wayland
+  sed  -i 's/-Wno-c++11-narrowing/-Wno-narrowing/' configure.ac
+  patch -Np1 -i ../icu59.patch
+  patch -Np1 -i ../make-4.3.patch
+  patch -p1 -i ../fix-ffms2-compat.patch
+  patch -p1 -i ../fix-ffms2-compat-2.patch
+  patch -p1 -i ../fix-ffms2-compat-3.patch
+
+  # Not sure when this broke and resulted in:
+  # > configure.ac: error: required file 'config.rpath' not found
+  cp /usr/share/gettext/config.rpath .
+
+  ./autogen.sh
+}
+
+build() {
+  cd Aegisub
+
+  # http://site.icu-project.org/download/61#TOC-Migration-Issues
+  CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'
+
+  ./configure \
+    --prefix=/usr \
+    --with-wx-config=/usr/bin/wx-config-gtk3 \
+    --without-{portaudio,openal,oss} \
+    --disable-update-checker
+  make
+}
+
+package() {
+  cd Aegisub
+
+  make DESTDIR="${pkgdir}" install
+
+  install -dm 755 "${pkgdir}"/usr/share/licenses/aegisub
+  install -m 644 LICENCE "${pkgdir}"/usr/share/licenses/aegisub/LICENSE
+}
+
+# vim: ts=2 sw=2 et:

Copied: aegisub/repos/community-staging-x86_64/boost-1.68.patch (from rev 1054124, aegisub/trunk/boost-1.68.patch)
===================================================================
--- community-staging-x86_64/boost-1.68.patch	                        (rev 0)
+++ community-staging-x86_64/boost-1.68.patch	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,34 @@
+From d8336d2fed73c72d1227b343d6acfb991bc1651b Mon Sep 17 00:00:00 2001
+From: Jan Beich <jbeich at FreeBSD.org>
+Date: Mon, 9 Jul 2018 20:15:29 +0000
+Subject: [PATCH] Keep using std::distance after Boost 1.68
+
+src/search_replace_engine.cpp:256:14: error: call to
+      'distance' is ambiguous
+                                count += distance(
+                                         ^~~~~~~~
+/usr/include/c++/v1/iterator:511:1: note: candidate function [with _InputIter =
+      boost::u32regex_iterator<std::__1::__wrap_iter<const char *> >]
+distance(_InputIter __first, _InputIter __last)
+^
+/usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate function [with SinglePassIterator =
+      boost::u32regex_iterator<std::__1::__wrap_iter<const char *> >]
+        distance(SinglePassIterator first, SinglePassIterator last)
+        ^
+---
+ src/search_replace_engine.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/search_replace_engine.cpp b/src/search_replace_engine.cpp
+index 594c21e5e..14c71680d 100644
+--- a/src/search_replace_engine.cpp
++++ b/src/search_replace_engine.cpp
+@@ -253,7 +253,7 @@ bool SearchReplaceEngine::ReplaceAll() {
+ 			if (MatchState ms = matches(&diag, 0)) {
+ 				auto& diag_field = diag.*get_dialogue_field(settings.field);
+ 				std::string const& text = diag_field.get();
+-				count += distance(
++				count += std::distance(
+ 					boost::u32regex_iterator<std::string::const_iterator>(begin(text), end(text), *ms.re),
+ 					boost::u32regex_iterator<std::string::const_iterator>());
+ 				diag_field = u32regex_replace(text, *ms.re, settings.replace_with);

Copied: aegisub/repos/community-staging-x86_64/fix-ffms2-compat-2.patch (from rev 1054124, aegisub/trunk/fix-ffms2-compat-2.patch)
===================================================================
--- community-staging-x86_64/fix-ffms2-compat-2.patch	                        (rev 0)
+++ community-staging-x86_64/fix-ffms2-compat-2.patch	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,23 @@
+From 7a6da26be6a830f4e1255091952cc0a1326a4520 Mon Sep 17 00:00:00 2001
+From: Thomas Goyne <plorkyeran at aegisub.org>
+Date: Fri, 8 Apr 2016 12:14:28 -0700
+Subject: [PATCH] Fix compilation on X11-using platforms
+
+---
+ src/ffmpegsource_common.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/ffmpegsource_common.h b/src/ffmpegsource_common.h
+index 5f6df7cfa..383d5baa2 100644
+--- a/src/ffmpegsource_common.h
++++ b/src/ffmpegsource_common.h
+@@ -51,6 +51,9 @@ class FFmpegSourceProvider {
+ public:
+ 	FFmpegSourceProvider(agi::BackgroundRunner *br);
+ 
++	// X11 is wonderful
++#undef None
++
+ 	enum class TrackSelection : int {
+ 		None = -1,
+ 		All = -2

Copied: aegisub/repos/community-staging-x86_64/fix-ffms2-compat-3.patch (from rev 1054124, aegisub/trunk/fix-ffms2-compat-3.patch)
===================================================================
--- community-staging-x86_64/fix-ffms2-compat-3.patch	                        (rev 0)
+++ community-staging-x86_64/fix-ffms2-compat-3.patch	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,106 @@
+commit 89c4e8d34ab77c3322f097b91fd9de22cbea7a37
+Author: Thomas Goyne <plorkyeran at aegisub.org>
+Date:   Wed Nov 21 16:41:05 2018 -0800
+
+    Update ffmpeg and ffms2
+
+diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp
+index 8bd68fbbf..f4ed6a2f2 100644
+--- a/src/video_provider_ffmpegsource.cpp
++++ b/src/video_provider_ffmpegsource.cpp
+@@ -44,6 +44,23 @@
+ #include <libaegisub/make_unique.h>
+ 
+ namespace {
++typedef enum AGI_ColorSpaces {
++	AGI_CS_RGB = 0,
++	AGI_CS_BT709 = 1,
++	AGI_CS_UNSPECIFIED = 2,
++	AGI_CS_FCC = 4,
++	AGI_CS_BT470BG = 5,
++	AGI_CS_SMPTE170M = 6,
++	AGI_CS_SMPTE240M = 7,
++	AGI_CS_YCOCG = 8,
++	AGI_CS_BT2020_NCL = 9,
++	AGI_CS_BT2020_CL = 10,
++	AGI_CS_SMPTE2085 = 11,
++	AGI_CS_CHROMATICITY_DERIVED_NCL = 12,
++	AGI_CS_CHROMATICITY_DERIVED_CL = 13,
++	AGI_CS_ICTCP = 14
++} AGI_ColorSpaces;
++
+ /// @class FFmpegSourceVideoProvider
+ /// @brief Implements video loading through the FFMS library.
+ class FFmpegSourceVideoProvider final : public VideoProvider, FFmpegSourceProvider {
+@@ -78,7 +95,7 @@ public:
+ 		if (matrix == RealColorSpace)
+ 			FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), nullptr);
+ 		else if (matrix == "TV.601")
+-			FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
++			FFMS_SetInputFormatV(VideoSource, AGI_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
+ 		else
+ 			return;
+ 		ColorSpace = matrix;
+@@ -103,16 +120,16 @@ std::string colormatrix_description(int cs, int cr) {
+ 	std::string str = cr == FFMS_CR_JPEG ? "PC" : "TV";
+ 
+ 	switch (cs) {
+-		case FFMS_CS_RGB:
++		case AGI_CS_RGB:
+ 			return "None";
+-		case FFMS_CS_BT709:
++		case AGI_CS_BT709:
+ 			return str + ".709";
+-		case FFMS_CS_FCC:
++		case AGI_CS_FCC:
+ 			return str + ".FCC";
+-		case FFMS_CS_BT470BG:
+-		case FFMS_CS_SMPTE170M:
++		case AGI_CS_BT470BG:
++		case AGI_CS_SMPTE170M:
+ 			return str + ".601";
+-		case FFMS_CS_SMPTE240M:
++		case AGI_CS_SMPTE240M:
+ 			return str + ".240M";
+ 		default:
+ 			throw VideoOpenError("Unknown video color space");
+@@ -206,8 +223,10 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
+ 
+ 	// set thread count
+ 	int Threads = OPT_GET("Provider/Video/FFmpegSource/Decoding Threads")->GetInt();
++#if FFMS_VERSION < ((2 << 24) | (30 << 16) | (0 << 8) | 0)
+ 	if (FFMS_GetVersion() < ((2 << 24) | (17 << 16) | (2 << 8) | 1) && FFMS_GetSourceType(Index) == FFMS_SOURCE_LAVF)
+ 		Threads = 1;
++#endif
+ 
+ 	// set seekmode
+ 	// TODO: give this its own option?
+@@ -235,18 +254,22 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
+ 	else
+ 		DAR = double(Width) / Height;
+ 
+-	CS = TempFrame->ColorSpace;
++	int VideoCS = CS = TempFrame->ColorSpace;
+ 	CR = TempFrame->ColorRange;
+ 
+-	if (CS == FFMS_CS_UNSPECIFIED)
+-		CS = Width > 1024 || Height >= 600 ? FFMS_CS_BT709 : FFMS_CS_BT470BG;
++	if (CS == AGI_CS_UNSPECIFIED)
++		CS = Width > 1024 || Height >= 600 ? AGI_CS_BT709 : AGI_CS_BT470BG;
+ 	RealColorSpace = ColorSpace = colormatrix_description(CS, CR);
+ 
+ #if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0)
+-	if (CS != FFMS_CS_RGB && CS != FFMS_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
+-		if (FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), &ErrInfo))
++	if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
++		CS = AGI_CS_BT470BG;
++		ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR);
++	}
++
++	if (CS != VideoCS) {
++		if (FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), &ErrInfo))
+ 			throw VideoOpenError(std::string("Failed to set input format: ") + ErrInfo.Buffer);
+-		ColorSpace = colormatrix_description(FFMS_CS_BT470BG, CR);
+ 	}
+ #endif
+ 

Copied: aegisub/repos/community-staging-x86_64/fix-ffms2-compat.patch (from rev 1054124, aegisub/trunk/fix-ffms2-compat.patch)
===================================================================
--- community-staging-x86_64/fix-ffms2-compat.patch	                        (rev 0)
+++ community-staging-x86_64/fix-ffms2-compat.patch	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,257 @@
+From 1aa9215e7fc360de05da9b7ec2cd68f1940af8b2 Mon Sep 17 00:00:00 2001
+From: Thomas Goyne <plorkyeran at aegisub.org>
+Date: Wed, 6 Apr 2016 11:24:21 -0700
+Subject: [PATCH] Use FFMS_DoIndexing2 when using a recent version of ffms2
+
+And clean up the audio track selection logic a bit.
+---
+ src/audio_provider_ffmpegsource.cpp | 40 ++++++++------------------
+ src/ffmpegsource_common.cpp         | 44 +++++++++++++++++++++--------
+ src/ffmpegsource_common.h           | 25 +++++-----------
+ src/video_provider_ffmpegsource.cpp | 12 ++++----
+ 4 files changed, 56 insertions(+), 65 deletions(-)
+
+diff --git a/src/audio_provider_ffmpegsource.cpp b/src/audio_provider_ffmpegsource.cpp
+index 4e44b1d29..606d5b415 100644
+--- a/src/audio_provider_ffmpegsource.cpp
++++ b/src/audio_provider_ffmpegsource.cpp
+@@ -91,18 +91,20 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) {
+ 	}
+ 
+ 	std::map<int, std::string> TrackList = GetTracksOfType(Indexer, FFMS_TYPE_AUDIO);
+-	if (TrackList.empty())
+-		throw agi::AudioDataNotFound("no audio tracks found");
+ 
+ 	// initialize the track number to an invalid value so we can detect later on
+ 	// whether the user actually had to choose a track or not
+ 	int TrackNumber = -1;
+ 	if (TrackList.size() > 1) {
+-		TrackNumber = AskForTrackSelection(TrackList, FFMS_TYPE_AUDIO);
+-		// if it's still -1 here, user pressed cancel
+-		if (TrackNumber == -1)
++		auto Selection = AskForTrackSelection(TrackList, FFMS_TYPE_AUDIO);
++		if (Selection == TrackSelection::None)
+ 			throw agi::UserCancelException("audio loading canceled by user");
++		TrackNumber = static_cast<int>(Selection);
+ 	}
++	else if (TrackList.size() == 1)
++		TrackNumber = TrackList.begin()->first;
++	else
++		throw agi::AudioDataNotFound("no audio tracks found");
+ 
+ 	// generate a name for the cache file
+ 	agi::fs::path CacheName = GetCacheFilename(filename);
+@@ -114,24 +116,13 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) {
+ 	if (Index && FFMS_IndexBelongsToFile(Index, filename.string().c_str(), &ErrInfo))
+ 		Index = nullptr;
+ 
+-	// index valid but track number still not set?
+ 	if (Index) {
+-		// track number not set? just grab the first track
+-		if (TrackNumber < 0)
+-			TrackNumber = FFMS_GetFirstTrackOfType(Index, FFMS_TYPE_AUDIO, &ErrInfo);
+-		if (TrackNumber < 0)
+-			throw agi::AudioDataNotFound(std::string("Couldn't find any audio tracks: ") + ErrInfo.Buffer);
+-
+-		// index is valid and track number is now set,
+-		// but do we have indexing info for the desired audio track?
++		// we already have an index, but the desired track may not have been
++		// indexed, and if it wasn't we need to reindex
+ 		FFMS_Track *TempTrackData = FFMS_GetTrackFromIndex(Index, TrackNumber);
+ 		if (FFMS_GetNumFrames(TempTrackData) <= 0)
+ 			Index = nullptr;
+ 	}
+-	// no valid index exists and the file only has one audio track, index it
+-	else if (TrackNumber < 0)
+-		TrackNumber = FFMS_TRACKMASK_ALL;
+-	// else: do nothing (keep track mask as it is)
+ 
+ 	// reindex if the error handling mode has changed
+ 	FFMS_IndexErrorHandling ErrorHandling = GetErrorHandlingMode();
+@@ -142,17 +133,10 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) {
+ 
+ 	// moment of truth
+ 	if (!Index) {
+-		int TrackMask;
+-		if (OPT_GET("Provider/FFmpegSource/Index All Tracks")->GetBool() || TrackNumber == FFMS_TRACKMASK_ALL)
+-			TrackMask = FFMS_TRACKMASK_ALL;
+-		else
+-			TrackMask = (1 << TrackNumber);
+-
++		TrackSelection TrackMask = static_cast<TrackSelection>(TrackNumber);
++		if (OPT_GET("Provider/FFmpegSource/Index All Tracks")->GetBool())
++			TrackMask = TrackSelection::All;
+ 		Index = DoIndexing(Indexer, CacheName, TrackMask, ErrorHandling);
+-
+-		// if tracknumber still isn't set we need to set it now
+-		if (TrackNumber == FFMS_TRACKMASK_ALL)
+-			TrackNumber = FFMS_GetFirstTrackOfType(Index, FFMS_TYPE_AUDIO, &ErrInfo);
+ 	}
+ 	else
+ 		FFMS_CancelIndexing(Indexer);
+diff --git a/src/ffmpegsource_common.cpp b/src/ffmpegsource_common.cpp
+index 60a7e91e6..d66be0222 100644
+--- a/src/ffmpegsource_common.cpp
++++ b/src/ffmpegsource_common.cpp
+@@ -60,7 +60,10 @@ FFmpegSourceProvider::FFmpegSourceProvider(agi::BackgroundRunner *br)
+ /// @param Indexer		A pointer to the indexer object representing the file to be indexed
+ /// @param CacheName    The filename of the output index file
+ /// @param Trackmask    A binary mask of the track numbers to index
+-FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, agi::fs::path const& CacheName, int Trackmask, FFMS_IndexErrorHandling IndexEH) {
++FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer,
++	                                         agi::fs::path const& CacheName,
++	                                         TrackSelection Track,
++	                                         FFMS_IndexErrorHandling IndexEH) {
+ 	char FFMSErrMsg[1024];
+ 	FFMS_ErrorInfo ErrInfo;
+ 	ErrInfo.Buffer		= FFMSErrMsg;
+@@ -78,8 +81,22 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, agi::fs::pat
+ 			ps->SetProgress(Current, Total);
+ 			return ps->IsCancelled();
+ 		};
+-		Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE,
++#if FFMS_VERSION >= ((2 << 24) | (21 << 16) | (0 << 8) | 0)
++		if (Track == TrackSelection::All)
++			FFMS_TrackTypeIndexSettings(Indexer, FFMS_TYPE_AUDIO, 1, 0);
++		else if (Track != TrackSelection::None)
++			FFMS_TrackIndexSettings(Indexer, static_cast<int>(Track), 1, 0);
++		FFMS_SetProgressCallback(Indexer, callback, ps);
++		Index = FFMS_DoIndexing2(Indexer, IndexEH, &ErrInfo);
++#else
++		int Trackmask = 0;
++		if (Track == TrackSelection::All)
++			Trackmask = std::numeric_limits<int>::max();
++		else if (Track != TrackSelection::None)
++			Trackmask = 1 << static_cast<int>(Track);
++		Index = FFMS_DoIndexing(Indexer, Trackmask, 0,
+ 			nullptr, nullptr, IndexEH, callback, ps, &ErrInfo);
++#endif
+ 	});
+ 
+ 	if (Index == nullptr)
+@@ -99,21 +116,24 @@ std::map<int, std::string> FFmpegSourceProvider::GetTracksOfType(FFMS_Indexer *I
+ 	std::map<int,std::string> TrackList;
+ 	int NumTracks = FFMS_GetNumTracksI(Indexer);
+ 
++	// older versions of ffms2 can't index audio tracks past 31
++#if FFMS_VERSION < ((2 << 24) | (21 << 16) | (0 << 8) | 0)
++	if (Type == FFMS_TYPE_AUDIO)
++		NumTracks = std::min(NumTracks, std::numeric_limits<int>::digits);
++#endif
++
+ 	for (int i=0; i<NumTracks; i++) {
+ 		if (FFMS_GetTrackTypeI(Indexer, i) == Type) {
+-			const char *CodecName = FFMS_GetCodecNameI(Indexer, i);
+-			if (CodecName)
+-				TrackList.insert(std::pair<int,std::string>(i, CodecName));
++			if (auto CodecName = FFMS_GetCodecNameI(Indexer, i))
++				TrackList[i] = CodecName;
+ 		}
+ 	}
+ 	return TrackList;
+ }
+ 
+-/// @brief Ask user for which track he wants to load
+-/// @param TrackList	A std::map with the track numbers as keys and codec names as values
+-/// @param Type			The track type to ask about
+-/// @return				Returns the track number chosen (an integer >= 0) on success, or a negative integer if the user cancelled.
+-int FFmpegSourceProvider::AskForTrackSelection(const std::map<int, std::string> &TrackList, FFMS_TrackType Type) {
++FFmpegSourceProvider::TrackSelection
++FFmpegSourceProvider::AskForTrackSelection(const std::map<int, std::string> &TrackList,
++                                           FFMS_TrackType Type) {
+ 	std::vector<int> TrackNumbers;
+ 	wxArrayString Choices;
+ 
+@@ -128,8 +148,8 @@ int FFmpegSourceProvider::AskForTrackSelection(const std::map<int, std::string>
+ 		Choices);
+ 
+ 	if (Choice < 0)
+-		return Choice;
+-	return TrackNumbers[Choice];
++		return TrackSelection::None;
++	return static_cast<TrackSelection>(TrackNumbers[Choice]);
+ }
+ 
+ /// @brief Set ffms2 log level according to setting in config.dat
+diff --git a/src/ffmpegsource_common.h b/src/ffmpegsource_common.h
+index 8cb7f33f6..5f6df7cfa 100644
+--- a/src/ffmpegsource_common.h
++++ b/src/ffmpegsource_common.h
+@@ -42,11 +42,6 @@
+ 
+ namespace agi { class BackgroundRunner; }
+ 
+-/// Index all tracks
+-#define FFMS_TRACKMASK_ALL		-1
+-/// Index no tracks
+-#define FFMS_TRACKMASK_NONE		0
+-
+ /// @class FFmpegSourceProvider
+ /// @brief Base class for FFMS2 source providers; contains common functions etc
+ class FFmpegSourceProvider {
+@@ -56,24 +51,18 @@ class FFmpegSourceProvider {
+ public:
+ 	FFmpegSourceProvider(agi::BackgroundRunner *br);
+ 
+-	/// Logging level constants from avutil/log.h
+-	enum FFMS_LogLevel {
+-		/// nothing printed
+-		FFMS_LOG_QUIET		= -8,
+-		FFMS_LOG_PANIC		= 0,
+-		FFMS_LOG_FATAL		= 8,
+-		FFMS_LOG_ERROR		= 16,
+-		FFMS_LOG_WARNING	= 24,
+-		FFMS_LOG_INFO		= 32,
+-		FFMS_LOG_VERBOSE	= 40,
+-		FFMS_LOG_DEBUG		= 48,
++	enum class TrackSelection : int {
++		None = -1,
++		All = -2
+ 	};
+ 
+ 	void CleanCache();
+ 
+-	FFMS_Index *DoIndexing(FFMS_Indexer *Indexer, agi::fs::path const& Cachename, int Trackmask, FFMS_IndexErrorHandling IndexEH);
++	FFMS_Index *DoIndexing(FFMS_Indexer *Indexer, agi::fs::path const& Cachename,
++		                   TrackSelection Track,
++		                   FFMS_IndexErrorHandling IndexEH);
+ 	std::map<int, std::string> GetTracksOfType(FFMS_Indexer *Indexer, FFMS_TrackType Type);
+-	int AskForTrackSelection(const std::map<int, std::string>& TrackList, FFMS_TrackType Type);
++	TrackSelection AskForTrackSelection(const std::map<int, std::string>& TrackList, FFMS_TrackType Type);
+ 	agi::fs::path GetCacheFilename(agi::fs::path const& filename);
+ 	void SetLogLevel();
+ 	FFMS_IndexErrorHandling GetErrorHandlingMode();
+diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp
+index 5fd14f69c..8bd68fbbf 100644
+--- a/src/video_provider_ffmpegsource.cpp
++++ b/src/video_provider_ffmpegsource.cpp
+@@ -149,14 +149,12 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
+ 	if (TrackList.size() <= 0)
+ 		throw VideoNotSupported("no video tracks found");
+ 
+-	// initialize the track number to an invalid value so we can detect later on
+-	// whether the user actually had to choose a track or not
+ 	int TrackNumber = -1;
+ 	if (TrackList.size() > 1) {
+-		TrackNumber = AskForTrackSelection(TrackList, FFMS_TYPE_VIDEO);
+-		// if it's still -1 here, user pressed cancel
+-		if (TrackNumber == -1)
++		auto Selection = AskForTrackSelection(TrackList, FFMS_TYPE_VIDEO);
++		if (Selection == TrackSelection::None)
+ 			throw agi::UserCancelException("video loading cancelled by user");
++		TrackNumber = static_cast<int>(Selection);
+ 	}
+ 
+ 	// generate a name for the cache file
+@@ -180,9 +178,9 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
+ 
+ 	// moment of truth
+ 	if (!Index) {
+-		int TrackMask = FFMS_TRACKMASK_NONE;
++		auto TrackMask = TrackSelection::None;
+ 		if (OPT_GET("Provider/FFmpegSource/Index All Tracks")->GetBool() || OPT_GET("Video/Open Audio")->GetBool())
+-			TrackMask = FFMS_TRACKMASK_ALL;
++			TrackMask = TrackSelection::All;
+ 		Index = DoIndexing(Indexer, CacheName, TrackMask, GetErrorHandlingMode());
+ 	}
+ 	else {

Copied: aegisub/repos/community-staging-x86_64/icu59.patch (from rev 1054124, aegisub/trunk/icu59.patch)
===================================================================
--- community-staging-x86_64/icu59.patch	                        (rev 0)
+++ community-staging-x86_64/icu59.patch	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,11 @@
+diff -upr aegisub-3.2.2.orig/src/utils.cpp aegisub-3.2.2/src/utils.cpp
+--- aegisub-3.2.2.orig/src/utils.cpp	2014-12-08 02:07:09.000000000 +0200
++++ aegisub-3.2.2/src/utils.cpp	2017-04-26 11:11:15.438239182 +0300
+@@ -44,6 +44,7 @@
+ #include <boost/filesystem/path.hpp>
+ #include <map>
+ #include <unicode/locid.h>
++#include <unicode/unistr.h>
+ #include <wx/clipbrd.h>
+ #include <wx/filedlg.h>
+ #include <wx/stdpaths.h>

Copied: aegisub/repos/community-staging-x86_64/make-4.3.patch (from rev 1054124, aegisub/trunk/make-4.3.patch)
===================================================================
--- community-staging-x86_64/make-4.3.patch	                        (rev 0)
+++ community-staging-x86_64/make-4.3.patch	2021-11-22 00:28:53 UTC (rev 1054125)
@@ -0,0 +1,23 @@
+From f4cc905c69ca69c68cb95674cefce4abc37ce046 Mon Sep 17 00:00:00 2001
+From: wangqr <wangqr at wangqr.tk>
+Date: Mon, 17 Feb 2020 14:42:07 +0800
+Subject: [PATCH] Use target name without directory in $*_OBJ macro
+
+Fix Aegisub/Aegisub#171
+---
+ Makefile.target | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.target b/Makefile.target
+index 516ef3c24..5c4c5d259 100644
+--- a/Makefile.target
++++ b/Makefile.target
+@@ -112,7 +112,7 @@ POST_FLAGS = $($@_FLAGS) -c -o $@ $<
+ # Libraries contain all object files they depend on (but they may depend on other files)
+ # Not using libtool on OS X because it has an unsilenceable warning about a
+ # compatibility issue with BSD 4.3 (wtf)
+-lib%.a: $$($$*_OBJ)
++lib%.a: $$($$(*F)_OBJ)
+ 	@$(BIN_MKDIR_P) $(dir $@)
+ 	$(BIN_AR) cru $@ $(filter %.o,$^)
+ 	$(BIN_RANLIB) $@



More information about the arch-commits mailing list