support avisynth portable

This commit is contained in:
Frank Skare
2020-05-06 11:11:09 +02:00
parent 56d954d94e
commit 4f96835e19
3 changed files with 14 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
============
- log error fix
- workaround to support AviSynth portable (ffmpeg blocks loading AviSynth from path env var)
5.4.6.0

View File

@@ -386,4 +386,4 @@ namespace mpvnet
KeyChar = e.Text;
}
}
}
}

View File

@@ -974,6 +974,7 @@ namespace mpvnet
for (int i = 0; i < files.Length; i++)
{
string file = files[i];
LoadLibrary(file.ShortExt());
if (App.SubtitleTypes.Contains(file.ShortExt()))
commandv("sub-add", file);
@@ -1020,6 +1021,17 @@ namespace mpvnet
commandv("playlist-move", "0", (index + 1).ToString());
}
bool wasAviSynthLoaded;
void LoadLibrary(string ext)
{
if (!wasAviSynthLoaded && ext == "avs")
{
WinAPI.LoadLibrary("AviSynth.dll");
wasAviSynthLoaded = true;
}
}
string LastHistoryPath;
DateTime LastHistoryStartDateTime;