0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

player/loadfile: enable streams in order of types when loading file

The previous commit to avoid refresh seeking video streams has an edge
case when enabling tracks when loading files. Since the streams are
initially unselected and then multiple streams are enabled, the detection
only works reliably when video tracks are enabled first.

This makes sure that loading file enables tracks in a predictable order.
This commit is contained in:
nanahi 2024-06-27 22:11:41 -04:00 committed by Dudemanguy
parent 33e414fa5d
commit b09e48e388

View File

@ -1724,8 +1724,10 @@ static void play_current_file(struct MPContext *mpctx)
}
}
for (int n = 0; n < mpctx->num_tracks; n++)
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++)
if (mpctx->tracks[n]->type == t)
reselect_demux_stream(mpctx, mpctx->tracks[n], false);
update_demuxer_properties(mpctx);