From 239dbb08c1010335eb5586ead8555ff249e906c9 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Tue, 19 Jul 2011 23:43:38 +0000 Subject: [PATCH] Let ffms2 set number of video decoding threads automatically. Patch by TheRyuu. Originally committed to SVN as r5491. --- aegisub/src/options.cpp | 2 +- aegisub/src/video_provider_ffmpegsource.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/aegisub/src/options.cpp b/aegisub/src/options.cpp index 065e22512..74ac230af 100644 --- a/aegisub/src/options.cpp +++ b/aegisub/src/options.cpp @@ -169,7 +169,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults,bool doOverride) { SetText(_T("Video Provider"),_T(DEFAULT_PROVIDER_VIDEO),1945); #endif SetBool(_T("FFmpeg allow unsafe seeking"),false); - SetInt(_T("FFmpegSource decoding threads"),1); + SetInt(_T("FFmpegSource threads"),-1); SetBool(_T("Allow Ancient Avisynth"),false,1700); #ifdef __WINDOWS__ SetText(_T("Subtitles Provider"),_T("csri/vsfilter_textsub"),1700); diff --git a/aegisub/src/video_provider_ffmpegsource.cpp b/aegisub/src/video_provider_ffmpegsource.cpp index e50fcada2..3de09d691 100644 --- a/aegisub/src/video_provider_ffmpegsource.cpp +++ b/aegisub/src/video_provider_ffmpegsource.cpp @@ -197,10 +197,8 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) { } } - // set thread count - int Threads = Options.AsInt(_T("FFmpegSource decoding threads")); - if (Threads < 1) - throw _T("FFmpegSource video provider: invalid decoding thread count"); + //number of threads automatically determined by ffms2 if given a value < 1 + int Threads = Options.AsInt(_T("FFmpegSource threads")); // set seekmode // TODO: give this its own option?