From bc675ea7ddee31c438284ba5e69ccff51c1fb2e5 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Sun, 3 Aug 2008 16:52:54 +0000 Subject: [PATCH] explicitly tell swscaler which scaling method to use (required by newer ffmpeg versions; no actual scaling is done, only colorspace conversion) Originally committed to SVN as r2294. --- aegisub/video_provider_lavc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/video_provider_lavc.cpp b/aegisub/video_provider_lavc.cpp index b42207ae0..124a749ee 100644 --- a/aegisub/video_provider_lavc.cpp +++ b/aegisub/video_provider_lavc.cpp @@ -424,7 +424,9 @@ const AegiVideoFrame LAVCVideoProvider::GetFrame(int n,int formatType) { unsigned int dstSize = avpicture_get_size(dstFormat,w,h); bufferRGB = new uint8_t[dstSize]; - sws_context = sws_getContext(w, h, srcFormat, w, h, dstFormat, SWS_PRINT_INFO, NULL, NULL, NULL); + sws_context = sws_getContext(w, h, srcFormat, w, h, dstFormat, SWS_PRINT_INFO | SWS_BICUBIC, NULL, NULL, NULL); + if (sws_context == NULL) + throw _T("ffmpeg video provider: failed to initialize SwScaler colorspace conversion"); } avpicture_fill((AVPicture*) frameRGB, bufferRGB, dstFormat, w, h);