From b2a3c231ff9fbd8dfeaaf636f5309f5a3ad5a7b3 Mon Sep 17 00:00:00 2001 From: stax76 Date: Wed, 27 Jul 2022 09:42:00 +0200 Subject: [PATCH] command line syntax is supported in mpv.conf --- docs/Changelog.md | 1 + docs/Manual.md | 4 +++- src/Misc/Player.cs | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 613624d..f802647 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -9,6 +9,7 @@ - Fix OSC hide behavior on mouse move. - New binding to show the current file in File Explorer. - Shift key enables `process-instance=multi`. +- Command line syntax (preceding double hyphen) is supported in mpv.conf for options implemented by mpv.net. - MediaInfo v22.06 - libmpv shinchiro 2022-07-02 diff --git a/docs/Manual.md b/docs/Manual.md index cd9fe00..d301af6 100644 --- a/docs/Manual.md +++ b/docs/Manual.md @@ -482,10 +482,12 @@ playback automatically resumes. Defines if more then one mpv.net process is allowed. -Tip: Whenever the CTRL key is pressed when files or URLs are opened, +Whenever the CTRL key is pressed when files or URLs are opened, the playlist is not cleared but the files or URLs are appended to the playlist. This not only works on process startup but in all mpv.net features that open files and URLs. +Multi can alternatively be enabled by pressing the SHIFT key. + **multi** Create a new process everytime the shell starts mpv.net. diff --git a/src/Misc/Player.cs b/src/Misc/Player.cs index a4e0a5d..1fd761c 100644 --- a/src/Misc/Player.cs +++ b/src/Misc/Player.cs @@ -378,6 +378,9 @@ namespace mpvnet string key = i.Substring(0, i.IndexOf("=")).Trim(); string value = i.Substring(i.IndexOf("=") + 1).Trim(); + if (key.StartsWith("-")) + key = key.TrimStart('-'); + if (value.Contains("#") && !value.StartsWith("#") && !value.StartsWith("'#") && !value.StartsWith("\"#"))