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/core.h | |
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/core.h')
-rw-r--r-- | player/core.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/player/core.h b/player/core.h index a13fa2852b..bbd3f5ce33 100644 --- a/player/core.h +++ b/player/core.h @@ -232,7 +232,10 @@ enum playback_status { const char *mp_status_str(enum playback_status st); -#define NUM_PTRACKS 2 +extern const int num_ptracks[STREAM_TYPE_COUNT]; + +// Maximum of all num_ptracks[] values. +#define MAX_PTRACKS 2 typedef struct MPContext { bool initialized; @@ -309,9 +312,9 @@ typedef struct MPContext { char *track_layout_hash; // Selected tracks. NULL if no track selected. - // There can be NUM_PTRACKS of the same STREAM_TYPE selected at once. + // There can be num_ptracks[type] of the same STREAM_TYPE selected at once. // Currently, this is used for the secondary subtitle track only. - struct track *current_track[NUM_PTRACKS][STREAM_TYPE_COUNT]; + struct track *current_track[MAX_PTRACKS][STREAM_TYPE_COUNT]; struct mp_filter *filter_root; |