diff --git a/src/audio_provider_ffmpegsource.cpp b/src/audio_provider_ffmpegsource.cpp index 606d5b415..b3ad702b0 100644 --- a/src/audio_provider_ffmpegsource.cpp +++ b/src/audio_provider_ffmpegsource.cpp @@ -126,10 +126,8 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) { // reindex if the error handling mode has changed FFMS_IndexErrorHandling ErrorHandling = GetErrorHandlingMode(); -#if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (2 << 8) | 0) if (Index && FFMS_GetErrorHandling(Index) != ErrorHandling) Index = nullptr; -#endif // moment of truth if (!Index) { @@ -167,7 +165,6 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) { throw agi::AudioProviderError("unknown or unsupported sample format"); } -#if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (4 << 8) | 0) if (channels > 1 || bytes_per_sample != 2) { std::unique_ptr opt(FFMS_CreateResampleOptions(AudioSource), FFMS_DestroyResampleOptions); @@ -181,7 +178,6 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) { float_samples = false; } } -#endif } } diff --git a/src/ffmpegsource_common.cpp b/src/ffmpegsource_common.cpp index db167e415..3ffa7f4fb 100644 --- a/src/ffmpegsource_common.cpp +++ b/src/ffmpegsource_common.cpp @@ -50,20 +50,6 @@ #include #include -#if FFMS_VERSION < ((2 << 24) | (22 << 16) | (0 << 8) | 0) -enum { - 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, - FFMS_LOG_TRACE = 56 -}; -#endif - FFmpegSourceProvider::FFmpegSourceProvider(agi::BackgroundRunner *br) : br(br) { @@ -95,7 +81,6 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, ps->SetProgress(Current, Total); return ps->IsCancelled(); }; -#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) @@ -103,15 +88,6 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, FFMS_TrackTypeIndexSettings(Indexer, FFMS_TYPE_VIDEO, 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::max(); - else if (Track != TrackSelection::None) - Trackmask = 1 << static_cast(Track); - Index = FFMS_DoIndexing(Indexer, Trackmask, 0, - nullptr, nullptr, IndexEH, callback, ps, &ErrInfo); -#endif }); if (Index == nullptr) @@ -131,12 +107,6 @@ std::map FFmpegSourceProvider::GetTracksOfType(FFMS_Indexer *I std::map 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::digits); -#endif - for (int i=0; i= ((2 << 24) | (17 << 16) | (1 << 8) | 0) if (matrix == ColorSpace) return; if (matrix == RealColorSpace) FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), nullptr); @@ -99,7 +98,6 @@ public: else return; ColorSpace = matrix; -#endif } int GetFrameCount() const override { return VideoInfo->NumFrames; } @@ -223,10 +221,6 @@ 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? @@ -261,7 +255,6 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st 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 != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && colormatrix == "TV.601") { CS = AGI_CS_BT470BG; ColorSpace = colormatrix_description(CS, CR); @@ -271,7 +264,6 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st if (FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), &ErrInfo)) throw VideoOpenError(std::string("Failed to set input format: ") + ErrInfo.Buffer); } -#endif const int TargetFormat[] = { FFMS_GetPixFmt("bgra"), -1 }; if (FFMS_SetOutputFormatV2(VideoSource, TargetFormat, Width, Height, FFMS_RESIZER_BICUBIC, &ErrInfo))