summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-11-01 10:37:52 -0500
committerDudemanguy <random342@airmail.cc>2023-11-01 10:37:52 -0500
commit250429dac6a72c6457960877bea5137b4f7acbbd (patch)
treec4647c33f53e5343d61bee4ef9cc7b6a513b7fc9 /options/m_option.c
parent98a27b3cd1e6af743af67699318df1946ce5bf8f (diff)
downloadmpv-250429dac6a72c6457960877bea5137b4f7acbbd.tar.bz2
mpv-250429dac6a72c6457960877bea5137b4f7acbbd.tar.xz
m_option: don't try to remove all filter matches
Probably should have actually tested the filter changes but I didn't. This was the wrong spot anyway since labels are unique. Something like this should have been done further down when finding it by content. On second thought, having multiple filters with the same content does have a usecase (e.g. stacking multiple rotations) so removing all of them at once probably isn't great. There's no practical usecase for having duplicates in a string list, so we'll leave that change alone. Fixes #12791.
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/options/m_option.c b/options/m_option.c
index 57ad06115a..789fb88ca8 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -3293,14 +3293,12 @@ static int parse_obj_settings_del(struct mp_log *log, struct bstr opt_name,
return 0;
if (dst) {
int label_index = 0;
- while (label_index >= 0) {
- label_index = obj_settings_list_find_by_label(VAL(dst), label);
- if (label_index >= 0) {
- mark_del[label_index] = true;
- } else {
- mp_warn(log, "Option %.*s: item label @%.*s not found.\n",
- BSTR_P(opt_name), BSTR_P(label));
- }
+ label_index = obj_settings_list_find_by_label(VAL(dst), label);
+ if (label_index >= 0) {
+ mark_del[label_index] = true;
+ } else {
+ mp_warn(log, "Option %.*s: item label @%.*s not found.\n",
+ BSTR_P(opt_name), BSTR_P(label));
}
}
*param = s;