Made Avisynth video provider use FFMpegSource for non avi/d2v/avs, but it will break for vfr because of the hack to make it work with dss
Originally committed to SVN as r1227.
This commit is contained in:
parent
354f96c081
commit
34cd74525d
1 changed files with 65 additions and 41 deletions
|
@ -225,8 +225,31 @@ PClip AvisynthVideoProvider::OpenVideo(wxString _filename, bool mpeg2dec3_priori
|
|||
script = env->Invoke("SetPlanarLegacyAlignment", script);
|
||||
}
|
||||
|
||||
// Some other format, such as mkv, mp4, ogm... try DirectShowSource
|
||||
// Some other format, such as mkv, mp4, ogm... try FFMpegSource and DirectShowSource
|
||||
else {
|
||||
// Try loading FFMpegSource
|
||||
bool ffsource = false;
|
||||
if (env->FunctionExists("ffmpegsource")) ffsource = true;
|
||||
if (!ffsource) {
|
||||
wxFileName ffsourcepath(AegisubApp::folderName + _T("ffmpegsource.dll"));
|
||||
if (ffsourcepath.FileExists()) {
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Loading FFMpegSource"));
|
||||
env->Invoke("LoadPlugin",env->SaveString(ffsourcepath.GetFullPath().mb_str(wxConvLocal)));
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Loaded FFMpegSource"));
|
||||
}
|
||||
}
|
||||
|
||||
// If FFMpegSource loaded properly, try using it
|
||||
ffsource = false;
|
||||
if (env->FunctionExists("ffmpegsource")) {
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Invoking FFMpegSource"));
|
||||
script = env->Invoke("ffmpegsource", videoFilename);
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Successfully opened file with FFMpegSource"));
|
||||
ffsource = true;
|
||||
}
|
||||
|
||||
// DirectShowSource
|
||||
if (!ffsource) {
|
||||
directshowOpen:
|
||||
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Opening file with DirectShowSource"));
|
||||
|
||||
|
@ -281,6 +304,7 @@ PClip AvisynthVideoProvider::OpenVideo(wxString _filename, bool mpeg2dec3_priori
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Catch errors
|
||||
catch (AvisynthError &err) {
|
||||
|
|
Loading…
Reference in a new issue