#435 Fix mpv options not working in case of existing same line comments

This commit is contained in:
stax76
2022-06-05 06:40:42 +02:00
parent 1561ed90f6
commit 0c6e486eb0
2 changed files with 12 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
is created with defaults for osc and console.
- Support mpv idle property, see manual for remarks.
- Fix external audio and subtitle files not shown in all use cases.
- Fix mpv options not working in case of existing same line comments.
- Fix crash choosing Matroska edition in the menu.
- Fix auto-play and auto-load-folder not working with user scripts.
- Fix slow startup using `osd-scale-by-window=no`.

View File

@@ -359,7 +359,17 @@ namespace mpvnet
if (File.Exists(ConfPath))
foreach (var i in File.ReadAllLines(ConfPath))
if (i.Contains("=") && !i.TrimStart().StartsWith("#"))
_Conf[i.Substring(0, i.IndexOf("=")).Trim()] = i.Substring(i.IndexOf("=") + 1).Trim();
{
string key = i.Substring(0, i.IndexOf("=")).Trim();
string value = i.Substring(i.IndexOf("=") + 1).Trim();
if (value.Contains("#") && !value.StartsWith("#") &&
!value.StartsWith("'#") && !value.StartsWith("\"#"))
value = value.Substring(0, value.IndexOf("#")).Trim();
_Conf[key] = value;
}
foreach (var i in _Conf)
ProcessProperty(i.Key, i.Value);