From f6c81047fa5a9199084fa92327c41c6d8a16b059 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 13 Apr 2020 15:55:51 +0200 Subject: player: do not fall back to a default track with explicit selections Consider e.g. --aid=2 with a file that has only 1 track. Then it would fall back to selecting track 1. Stop doing this. If no matching track is found, this will not select any track now. Note that the fingerprint stuff (track_layout_hash in the source) prevents softens the impact of this change. Without the fingerprint, playing a dual-audio file with the second track selected, and then a single-audio file, would play the second file without audio. But the fingerprint resets it due to differences in the track list. Try to exhaustively document this and tricky interactions between the other features. What a damn mess, I think it's simply cursed. Of course it's still my fault. See: #7608 --- player/loadfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'player') diff --git a/player/loadfile.c b/player/loadfile.c index 8e40992a04..d09addeb89 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -522,6 +522,8 @@ struct track *select_default_track(struct MPContext *mpctx, int order, continue; if (track->user_tid == tid) return track; + if (tid >= 0) + continue; if (track->no_auto_select) continue; if (duplicate_track(mpctx, order, type, track)) -- cgit v1.2.3