summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-15 17:10:01 +0200
committerwm4 <wm4@nowhere>2020-04-15 17:10:01 +0200
commitcc2ee06e576f59d95adc2e863ac8efcca89ad588 (patch)
tree9a3c7e58f6aa006ed4c368c7dea92ae7f902f25f /player/loadfile.c
parent6c02555397ca599a7ec9ea781e492631ecf1c7f2 (diff)
downloadmpv-cc2ee06e576f59d95adc2e863ac8efcca89ad588.tar.bz2
mpv-cc2ee06e576f59d95adc2e863ac8efcca89ad588.tar.xz
player: remove duplicated track option setter code
Well whatever.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 8461731518..97ae9328f1 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -573,11 +573,8 @@ static void check_previous_track_selection(struct MPContext *mpctx)
// defaults are -1 (default selection), or -2 (off) for secondary tracks.
for (int t = 0; t < STREAM_TYPE_COUNT; t++) {
for (int i = 0; i < num_ptracks[t]; i++) {
- if (opts->stream_id[i][t] >= 0) {
- opts->stream_id[i][t] = i == 0 ? -1 : -2;
- m_config_notify_change_opt_ptr(mpctx->mconfig,
- &opts->stream_id[i][t]);
- }
+ if (opts->stream_id[i][t] >= 0)
+ mark_track_selection(mpctx, i, t, i == 0 ? -1 : -2);
}
}
talloc_free(mpctx->track_layout_hash);
@@ -586,8 +583,9 @@ static void check_previous_track_selection(struct MPContext *mpctx)
talloc_free(h);
}
-static void mark_track_selection(struct MPContext *mpctx, int order,
- enum stream_type type, int value)
+// Update the matching track selection user option to the given value.
+void mark_track_selection(struct MPContext *mpctx, int order,
+ enum stream_type type, int value)
{
assert(order >= 0 && order < num_ptracks[type]);
mpctx->opts->stream_id[order][type] = value;