From cc9cc6d713ad3acf7f4bc78221a1c12ccd09f823 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 17 Oct 2011 17:52:11 +0000 Subject: [PATCH] Use FFMS_SetOutputFormatV2 with sufficiently recent FFMS2 rather than the deprecated FFMS_SetOutputFormatV Originally committed to SVN as r5740. --- aegisub/src/video_provider_ffmpegsource.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aegisub/src/video_provider_ffmpegsource.cpp b/aegisub/src/video_provider_ffmpegsource.cpp index 17108624d..cf4453cd5 100644 --- a/aegisub/src/video_provider_ffmpegsource.cpp +++ b/aegisub/src/video_provider_ffmpegsource.cpp @@ -223,7 +223,12 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) { Width = TempFrame->EncodedWidth; Height = TempFrame->EncodedHeight; +#if FFMS_VERSION >= ((2 << 24) | (15 << 16) | (3 << 8) | 0) + const int TargetFormat[] = { FFMS_GetPixFmt("bgra"), -1 }; + if (FFMS_SetOutputFormatV2(VideoSource, TargetFormat, Width, Height, FFMS_RESIZER_BICUBIC, &ErrInfo)) { +#else if (FFMS_SetOutputFormatV(VideoSource, 1LL << FFMS_GetPixFmt("bgra"), Width, Height, FFMS_RESIZER_BICUBIC, &ErrInfo)) { +#endif throw VideoOpenError(std::string("Failed to set output format: ") + ErrInfo.Buffer); }