From b364e4a65c6947ddb7e8b5d50dbc5dd63ad9e780 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 20 Apr 2024 00:50:17 -0500 Subject: [PATCH 1/2] player/loadfile: check if forced track is also tagged as default first If a forced sub track also happens to be tagged as default, we should check that before deselecting in compare_track. Fixes #13944. --- player/loadfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player/loadfile.c b/player/loadfile.c index 7421a47d26c6b..a8dfda8c1c2e3 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -511,10 +511,10 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs, bool return l1 > l2; if (forced) return t1->forced_track; - if (sub && !t2->forced_select && t2->forced_track) - return !t1->forced_track; if (t1->default_track != t2->default_track && !t2->forced_select) return t1->default_track; + if (sub && !t2->forced_select && t2->forced_track) + return !t1->forced_track; if (os_langs && l1 != l2) return l1 > l2; if (t1->attached_picture != t2->attached_picture) From 5318522b500d89593afc79840445ed723b30f50d Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sat, 20 Apr 2024 10:16:53 -0400 Subject: [PATCH 2/2] DOCS/man: refer to "mp.options functions" for script config docs Currently they refer to the OSC documentation. However, the "mp.options functions" already documents that, is more detailed, and does not contain false statements like "there may be no spaces around the ``=`` or anywhere else" (the primitive parser does not care about them, so starting a string option value with spaces is perfectly fine). Change them to refer to "mp.options functions" and remove the redundant section in the OSC documentation. --- DOCS/man/console.rst | 2 +- DOCS/man/osc.rst | 19 +++---------------- DOCS/man/stats.rst | 2 +- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/DOCS/man/console.rst b/DOCS/man/console.rst index b9f169f1cc874..69cc103c15512 100644 --- a/DOCS/man/console.rst +++ b/DOCS/man/console.rst @@ -123,7 +123,7 @@ Configuration This script can be customized through a config file ``script-opts/console.conf`` placed in mpv's user directory and through the ``--script-opts`` command-line -option. The configuration syntax is described in `ON SCREEN CONTROLLER`_. +option. The configuration syntax is described in `mp.options functions`_. Key bindings can be changed in a standard way, see for example stats.lua documentation. diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 731485a6622bb..97b4f4818e97b 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -130,22 +130,9 @@ del Cycles visibility between never / auto (mouse-move) / always Configuration ------------- -The OSC offers limited configuration through a config file -``script-opts/osc.conf`` placed in mpv's user dir and through the -``--script-opts`` command-line option. Options provided through the command-line -will override those from the config file. - -Config Syntax -~~~~~~~~~~~~~ - -The config file must exactly follow the following syntax:: - - # this is a comment - optionA=value1 - optionB=value2 - -``#`` can only be used at the beginning of a line and there may be no -spaces around the ``=`` or anywhere else. +This script can be customized through a config file ``script-opts/osc.conf`` +placed in mpv's user directory and through the ``--script-opts`` command-line +option. The configuration syntax is described in `mp.options functions`_. Command-line Syntax ~~~~~~~~~~~~~~~~~~~ diff --git a/DOCS/man/stats.rst b/DOCS/man/stats.rst index bc8f04f1a8b3d..8bc0a3c651837 100644 --- a/DOCS/man/stats.rst +++ b/DOCS/man/stats.rst @@ -43,7 +43,7 @@ Configuration This script can be customized through a config file ``script-opts/stats.conf`` placed in mpv's user directory and through the ``--script-opts`` command-line -option. The configuration syntax is described in `ON SCREEN CONTROLLER`_. +option. The configuration syntax is described in `mp.options functions`_. Configurable Options ~~~~~~~~~~~~~~~~~~~~