void-packages/srcpkgs/Aegisub/patches/fix-ffms2-2.40.patch
2021-01-18 21:25:55 +01:00

87 lines
3.2 KiB
Diff

Source: @pullmoll
Upstream: no
Reason: ffms2 no longer provides color space enum values; use the ffmpeg ones
--- src/ffmpegsource_common.cpp 2014-12-08 01:07:09.000000000 +0100
+++ src/ffmpegsource_common.cpp 2021-01-18 21:12:42.209582337 +0100
@@ -98,7 +98,6 @@
ps->SetProgress(Current, Total);
return ps->IsCancelled();
};
- Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE,
- nullptr, nullptr, IndexEH, callback, ps, &ErrInfo);
+ Index = FFMS_DoIndexing2(Indexer, FFMS_IEH_ABORT, &ErrInfo);
});
--- src/video_provider_ffmpegsource.cpp 2014-12-08 01:07:09.000000000 +0100
+++ src/video_provider_ffmpegsource.cpp 2021-01-18 21:07:47.205800051 +0100
@@ -42,6 +42,7 @@
#include <libaegisub/fs.h>
#include <libaegisub/make_unique.h>
+#include <libavutil/pixfmt.h>
namespace {
/// @class FFmpegSourceVideoProvider
@@ -78,7 +79,7 @@
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, AVCOL_SPC_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
else
return;
ColorSpace = matrix;
@@ -103,16 +104,16 @@
std::string str = cr == FFMS_CR_JPEG ? "PC" : "TV";
switch (cs) {
- case FFMS_CS_RGB:
+ case AVCOL_SPC_RGB:
return "None";
- case FFMS_CS_BT709:
+ case AVCOL_SPC_BT709:
return str + ".709";
- case FFMS_CS_FCC:
+ case AVCOL_SPC_FCC:
return str + ".FCC";
- case FFMS_CS_BT470BG:
- case FFMS_CS_SMPTE170M:
+ case AVCOL_SPC_BT470BG:
+ case AVCOL_SPC_SMPTE170M:
return str + ".601";
- case FFMS_CS_SMPTE240M:
+ case AVCOL_SPC_SMPTE240M:
return str + ".240M";
default:
throw VideoOpenError("Unknown video color space");
@@ -208,8 +209,6 @@
// set thread count
int Threads = OPT_GET("Provider/Video/FFmpegSource/Decoding Threads")->GetInt();
- if (FFMS_GetVersion() < ((2 << 24) | (17 << 16) | (2 << 8) | 1) && FFMS_GetSourceType(Index) == FFMS_SOURCE_LAVF)
- Threads = 1;
// set seekmode
// TODO: give this its own option?
@@ -240,15 +239,15 @@
CS = TempFrame->ColorSpace;
CR = TempFrame->ColorRange;
- if (CS == FFMS_CS_UNSPECIFIED)
- CS = Width > 1024 || Height >= 600 ? FFMS_CS_BT709 : FFMS_CS_BT470BG;
+ if (CS == AVCOL_SPC_UNSPECIFIED)
+ CS = Width > 1024 || Height >= 600 ? AVCOL_SPC_BT709 : AVCOL_SPC_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 != AVCOL_SPC_RGB && CS != AVCOL_SPC_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
+ if (FFMS_SetInputFormatV(VideoSource, AVCOL_SPC_BT470BG, CR, FFMS_GetPixFmt(""), &ErrInfo))
throw VideoOpenError(std::string("Failed to set input format: ") + ErrInfo.Buffer);
- ColorSpace = colormatrix_description(FFMS_CS_BT470BG, CR);
+ ColorSpace = colormatrix_description(AVCOL_SPC_BT470BG, CR);
}
#endif