summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-03 23:58:19 +0100
committerwm4 <wm4@nowhere>2014-03-03 23:58:19 +0100
commit43e997ca07f43598f49e1a0f1f3c52e08a9179f3 (patch)
tree97076f448785b2bf24ac3a04ecc81822daad2020 /player/loadfile.c
parent59d9007e15fe30fd0ed24580eb461ae02d497f40 (diff)
downloadmpv-43e997ca07f43598f49e1a0f1f3c52e08a9179f3.tar.bz2
mpv-43e997ca07f43598f49e1a0f1f3c52e08a9179f3.tar.xz
player: reformat some code
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index fbd9797490..7cfaf67978 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -662,17 +662,12 @@ void mp_switch_track_n(struct MPContext *mpctx, int order, enum stream_type type
reselect_demux_streams(mpctx);
- if (order == 0) {
- if (type == STREAM_VIDEO) {
- reinit_video_chain(mpctx);
- } else if (type == STREAM_AUDIO) {
- reinit_audio_chain(mpctx);
- } else if (type == STREAM_SUB) {
- reinit_subs(mpctx, 0);
- }
- } else if (order == 1) {
- if (type == STREAM_SUB)
- reinit_subs(mpctx, 1);
+ if (type == STREAM_VIDEO && order == 0) {
+ reinit_video_chain(mpctx);
+ } else if (type == STREAM_AUDIO && order == 0) {
+ reinit_audio_chain(mpctx);
+ } else if (type == STREAM_SUB && order >= 0 && order <= 2) {
+ reinit_subs(mpctx, order);
}
mp_notify(mpctx, MPV_EVENT_TRACK_SWITCHED, NULL);
@@ -703,17 +698,14 @@ void mp_mark_user_track_selection(struct MPContext *mpctx, int order,
{
struct track *track = mpctx->current_track[order][type];
int user_tid = track ? track->user_tid : -2;
- if (order == 0) {
- if (type == STREAM_VIDEO) {
- mpctx->opts->video_id = user_tid;
- } else if (type == STREAM_AUDIO) {
- mpctx->opts->audio_id = user_tid;
- } else if (type == STREAM_SUB) {
- mpctx->opts->sub_id = user_tid;
- }
- } else if (order == 1) {
- if (type == STREAM_SUB)
- mpctx->opts->sub2_id = user_tid;
+ if (type == STREAM_VIDEO && order == 0) {
+ mpctx->opts->video_id = user_tid;
+ } else if (type == STREAM_AUDIO && order == 0) {
+ mpctx->opts->audio_id = user_tid;
+ } else if (type == STREAM_SUB && order == 0) {
+ mpctx->opts->sub_id = user_tid;
+ } else if (type == STREAM_SUB && order == 1) {
+ mpctx->opts->sub2_id = user_tid;
}
}