diff options
author | wm4 <wm4@nowhere> | 2020-04-15 17:03:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-04-15 17:04:00 +0200 |
commit | 6c02555397ca599a7ec9ea781e492631ecf1c7f2 (patch) | |
tree | aaeaf1c14e7cdcbbfcbdc331e5b31d0cf040b9ff /player/command.c | |
parent | dae0652e19c568f578642993ad96531f56c5d259 (diff) | |
download | mpv-6c02555397ca599a7ec9ea781e492631ecf1c7f2.tar.bz2 mpv-6c02555397ca599a7ec9ea781e492631ecf1c7f2.tar.xz |
player: slightly improve use of secondary track selection limits
Apparently, this was a bit of a mess, which caused the bug fixed by
commit ec7f2388af2df. Try to improve this, and only use track selection
entries that exist.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/player/command.c b/player/command.c index 8c383a930b..c10c4374aa 100644 --- a/player/command.c +++ b/player/command.c @@ -6224,7 +6224,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, mp_update_logging(mpctx, false); if (flags & (UPDATE_OSD | UPDATE_SUB_FILT)) { - for (int n = 0; n < NUM_PTRACKS; n++) { + for (int n = 0; n < num_ptracks[STREAM_SUB]; n++) { struct track *track = mpctx->current_track[n][STREAM_SUB]; struct dec_sub *sub = track ? track->d_sub : NULL; if (sub) { @@ -6352,8 +6352,8 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, if (opt_ptr == &opts->af_settings) set_filters(mpctx, STREAM_AUDIO, opts->af_settings); - for (int order = 0; order < NUM_PTRACKS; order++) { - for (int type = 0; type < STREAM_TYPE_COUNT; type++) { + for (int type = 0; type < STREAM_TYPE_COUNT; type++) { + for (int order = 0; order < num_ptracks[type]; order++) { if (opt_ptr == &opts->stream_id[order][type] && mpctx->playback_initialized) { |