From b2153dd6cfba36daeec67bdcd5df8ed8b480544d Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Wed, 3 Sep 2008 21:22:33 +0000 Subject: [PATCH] add option for ffmpegsource thread count and seek mode Originally committed to SVN as r2314. --- aegisub/video_provider_ffmpegsource.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/aegisub/video_provider_ffmpegsource.cpp b/aegisub/video_provider_ffmpegsource.cpp index 48699bdbd..ccf969145 100644 --- a/aegisub/video_provider_ffmpegsource.cpp +++ b/aegisub/video_provider_ffmpegsource.cpp @@ -41,7 +41,7 @@ #include #include "vfr.h" #include "video_context.h" -// #include "options.h" // for later use +#include "options.h" // for later use /////////////// @@ -97,13 +97,18 @@ void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename, double fps) } } - // TODO: make this user-configurable - int Threads = 1; + // set thread count + int Threads = Options.AsInt(_T("FFmpegSource decoding threads")); if (Threads < 1) throw _T("FFmpegSource video provider: invalid decoding thread count"); - // TODO: tie this to the option "ffmpeg allow unsafe seeking" - int SeekMode = 1; + // set seekmode + // TODO: give this its own option? + int SeekMode; + if (Options.AsBool(_T("FFmpeg allow unsafe seeking"))) + SeekMode = 2; + else + SeekMode = 1; // finally create the actual video source VideoSource = FFMS_CreateVideoSource(FileNameWX.char_str(), -1, Index, "", Threads, SeekMode, FFMSErrorMessage, MessageSize);