From 314e80f2ec3cacc8d751c461d3bf2d2af939db9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 17 May 2026 02:55:41 +0200 Subject: [PATCH] loadfile: reselect dependent tracks only when selected by user --- player/loadfile.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/player/loadfile.c b/player/loadfile.c index 02b30b1e36..156caa8975 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1919,10 +1919,18 @@ static void play_current_file(struct MPContext *mpctx) } process_hooks(mpctx, "on_loaded"); - for (int t = 0; t < STREAM_TYPE_COUNT; t++) - for (int n = 0; n < mpctx->num_tracks; n++) - if (mpctx->tracks[n]->type == t) - reselect_demux_stream(mpctx, mpctx->tracks[n], false); + for (int t = 0; t < STREAM_TYPE_COUNT; t++) { + for (int n = 0; n < mpctx->num_tracks; n++) { + struct track *track = mpctx->tracks[n]; + if (track->type != t) + continue; + // Only reselect dependent tracks when explicitly selected by user + if (track->stream && track->stream->dependent_track && + !track->selected) + continue; + reselect_demux_stream(mpctx, track, false); + } + } update_demuxer_properties(mpctx);