diff options
author | wm4 <wm4@nowhere> | 2018-03-02 17:12:27 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-03-03 02:38:01 +0200 |
commit | 8ce5e794fb46f66fd283044cdd983f838daafb45 (patch) | |
tree | c406249b89383f7f8827030572b77d3f570f1700 /player | |
parent | 70ea586eb5493624cf45c81153d41bbd29153140 (diff) | |
download | mpv-8ce5e794fb46f66fd283044cdd983f838daafb45.tar.bz2 mpv-8ce5e794fb46f66fd283044cdd983f838daafb45.tar.xz |
player: fix track autoselection of external files yet again
If you used --aufio-file=file.mkv, and file.mkv included a video track
marked as default, then the logic in select_default_track() would pick
the video track from file.mkv. This is 100% broken, so fix it.
Diffstat (limited to 'player')
-rw-r--r-- | player/loadfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index 2499c01517..fa72a079ef 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -575,8 +575,8 @@ bool mp_remove_track(struct MPContext *mpctx, struct track *track) return true; } -// Add the given file as additional track. Only tracks of type "filter" are -// included; pass STREAM_TYPE_COUNT to disable filtering. +// Add the given file as additional track. The filter argument controls how or +// if tracks are auto-selected at any point. int mp_add_external_file(struct MPContext *mpctx, char *filename, enum stream_type filter) { @@ -634,7 +634,7 @@ int mp_add_external_file(struct MPContext *mpctx, char *filename, t->title = talloc_strdup(t, mp_basename(disp_filename)); t->external_filename = talloc_strdup(t, filename); t->no_default = sh->type != filter; - t->no_auto_select = filter == STREAM_TYPE_COUNT; + t->no_auto_select = t->no_default; if (first_num < 0 && (filter == STREAM_TYPE_COUNT || sh->type == filter)) first_num = mpctx->num_tracks - 1; } |