Removed FFMS2 usage from the Avisynth video provider. If you want FFMS2, use the FFMS2 provider.

Originally committed to SVN as r3188.
This commit is contained in:
Karl Blomster 2009-07-21 20:36:27 +00:00
parent ce2a549517
commit 38c5f8200a
1 changed files with 44 additions and 71 deletions

View File

@ -174,37 +174,11 @@ PClip AvisynthVideoProvider::OpenVideo(Aegisub::String _filename, bool mpeg2dec3
script = env->Invoke("SetPlanarLegacyAlignment", script);
}
// Some other format, such as mkv, mp4, ogm... try FFMpegSource and DirectShowSource
// Some other format, such as mkv, mp4, ogm... try both flavors of DirectShowSource
else {
// Try loading FFMpegSource
directshowOpen:
bool ffsource = false;
if (env->FunctionExists("ffvideosource")) ffsource = true;
if (!ffsource) {
wxFileName ffsourcepath(StandardPaths::DecodePath(_T("?data/ffms2.dll")));
if (ffsourcepath.FileExists()) {
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Loading FFMpegSource2"));
env->Invoke("LoadPlugin",env->SaveString(ffsourcepath.GetFullPath().mb_str(csConvLocal)));
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Loaded FFMpegSource2"));
byFrame = true;
}
}
// If FFMpegSource loaded properly, try using it
ffsource = false;
if (env->FunctionExists("ffvideosource")) {
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Invoking FFMpegSource2"));
const char *argnames[2] = { "source", "cache" };
AVSValue args[2] = { videoFilename, false };
script = env->Invoke("ffvideosource", AVSValue(args,2), argnames);
//script = env->Invoke("ffmpegsource", videoFilename);
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Successfully opened file with FFMpegSource2"));
ffsource = true;
decoderName = _T("FFmpegSource2");
}
// DirectShowSource
if (!ffsource) {
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Opening file with DirectShowSource"));
// Try loading DirectShowSource2
@ -257,7 +231,6 @@ PClip AvisynthVideoProvider::OpenVideo(Aegisub::String _filename, bool mpeg2dec3
}
}
}
}
// Catch errors
catch (AvisynthError &err) {