Skip to content

Commit 08e9e80

Browse files
committed
Remove ffms2 version ifdefs
1 parent 2eb7364 commit 08e9e80

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/video_provider_ffmpegsource.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,9 @@ class FFmpegSourceVideoProvider final : public VideoProvider, FFmpegSourceProvid
103103

104104
int GetFrameCount() const override { return VideoInfo->NumFrames; }
105105

106-
#if FFMS_VERSION >= ((2 << 24) | (24 << 16) | (0 << 8) | 0)
107106
int GetWidth() const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90) ? Height : Width; }
108107
int GetHeight() const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90) ? Width : Height; }
109108
double GetDAR() const override { return (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 180 == -90) ? 1 / DAR : DAR; }
110-
#else
111-
int GetWidth() const override { return Width; }
112-
int GetHeight() const override { return Height; }
113-
double GetDAR() const override { return DAR; }
114-
#endif
115109

116110
agi::vfr::Framerate GetFPS() const override { return Timecodes; }
117111
std::string GetColorSpace() const override { return ColorSpace; }
@@ -230,10 +224,6 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
230224

231225
// set thread count
232226
int Threads = OPT_GET("Provider/Video/FFmpegSource/Decoding Threads")->GetInt();
233-
#if FFMS_VERSION < ((2 << 24) | (30 << 16) | (0 << 8) | 0)
234-
if (FFMS_GetVersion() < ((2 << 24) | (17 << 16) | (2 << 8) | 1) && FFMS_GetSourceType(Index) == FFMS_SOURCE_LAVF)
235-
Threads = 1;
236-
#endif
237227

238228
// set seekmode
239229
// TODO: give this its own option?
@@ -323,7 +313,7 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
323313
out.width = Width;
324314
out.height = Height;
325315
out.pitch = frame->Linesize[0];
326-
#if FFMS_VERSION >= ((2 << 24) | (31 << 16) | (0 << 8) | 0)
316+
327317
// Handle flip
328318
if (VideoInfo->Flip > 0)
329319
for (int x = 0; x < Height; ++x)
@@ -336,8 +326,7 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
336326
for (int y = 0; y < Width; ++y)
337327
for (int ch = 0; ch < 4; ++ch)
338328
std::swap(out.data[frame->Linesize[0] * x + 4 * y + ch], out.data[frame->Linesize[0] * (Height - 1 - x) + 4 * y + ch]);
339-
#endif
340-
#if FFMS_VERSION >= ((2 << 24) | (24 << 16) | (0 << 8) | 0)
329+
341330
// Handle rotation
342331
if (VideoInfo->Rotation % 360 == 180 || VideoInfo->Rotation % 360 == -180) {
343332
std::vector<unsigned char> data(std::move(out.data));
@@ -370,7 +359,6 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
370359
out.height = Width;
371360
out.pitch = 4 * Height;
372361
}
373-
#endif
374362
}
375363
}
376364

0 commit comments

Comments
 (0)