player/command: destroy cached packets after UPDATE_SUB_{FILT,HARD}

Otherwise, the index can technically grow forever because
sub_read_packets will trigger again, read the same packets, then add
them to the list. We should just clear the cache here in this case to
reset it back to 0. Also flag redraw_subs here as well.
This commit is contained in:
Dudemanguy
2024-10-14 15:44:25 -05:00
parent d2d8667259
commit fe758a1761

View File

@@ -7426,11 +7426,14 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
(void *)(uintptr_t)flags);
if (ret == CONTROL_OK && flags & (UPDATE_SUB_FILT | UPDATE_SUB_HARD)) {
sub_redecode_cached_packets(sub);
sub_reset(sub);
if (track->selected)
reselect_demux_stream(mpctx, track, true);
}
}
}
// For subs on a still image.
redraw_subs(mpctx);
osd_changed(mpctx->osd);
}