forked from mia/Aegisub
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:
parent
ce2a549517
commit
38c5f8200a
1 changed files with 44 additions and 71 deletions
|
@ -174,37 +174,11 @@ PClip AvisynthVideoProvider::OpenVideo(Aegisub::String _filename, bool mpeg2dec3
|
||||||
script = env->Invoke("SetPlanarLegacyAlignment", script);
|
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 {
|
else {
|
||||||
// Try loading FFMpegSource
|
|
||||||
directshowOpen:
|
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
|
// DirectShowSource
|
||||||
if (!ffsource) {
|
|
||||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Opening file with DirectShowSource"));
|
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Opening file with DirectShowSource"));
|
||||||
|
|
||||||
// Try loading DirectShowSource2
|
// Try loading DirectShowSource2
|
||||||
|
@ -257,7 +231,6 @@ PClip AvisynthVideoProvider::OpenVideo(Aegisub::String _filename, bool mpeg2dec3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Catch errors
|
// Catch errors
|
||||||
catch (AvisynthError &err) {
|
catch (AvisynthError &err) {
|
||||||
|
|
Loading…
Reference in a new issue