loadfile: reselect dependent tracks only when selected by user

This commit is contained in:
Kacper Michajłow
2026-07-01 04:46:42 +02:00
parent 25606307ff
commit 314e80f2ec
+12 -4
View File
@@ -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);