diff options
author | wm4 <wm4@nowhere> | 2015-05-22 21:00:24 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-22 21:00:24 +0200 |
commit | ae46833836453b7fc64f2cff9cb69d6cfd73f947 (patch) | |
tree | b7ecb83b01279fc427348025f158d9fa14d7bd25 /options/options.c | |
parent | a7c831f36d17fae13ef441a8f56281557cccd401 (diff) | |
download | mpv-ae46833836453b7fc64f2cff9cb69d6cfd73f947.tar.bz2 mpv-ae46833836453b7fc64f2cff9cb69d6cfd73f947.tar.xz |
player: use an array for stream ID options and such
This makes the code slightly more generic.
Diffstat (limited to 'options/options.c')
-rw-r--r-- | options/options.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/options/options.c b/options/options.c index 44d4beae30..b2bd5c2e95 100644 --- a/options/options.c +++ b/options/options.c @@ -194,18 +194,18 @@ const m_option_t mp_opts[] = { OPT_CHOICE("index", index_mode, 0, ({"default", 1}, {"recreate", 0})), // select audio/video/subtitle stream - OPT_TRACKCHOICE("aid", audio_id), - OPT_TRACKCHOICE("vid", video_id), - OPT_TRACKCHOICE("sid", sub_id), - OPT_TRACKCHOICE("secondary-sid", sub2_id), - OPT_TRACKCHOICE("ff-aid", audio_id_ff), - OPT_TRACKCHOICE("ff-vid", video_id_ff), - OPT_TRACKCHOICE("ff-sid", sub_id_ff), - OPT_FLAG_STORE("no-sub", sub_id, 0, -2), - OPT_FLAG_STORE("no-video", video_id, 0, -2), - OPT_FLAG_STORE("no-audio", audio_id, 0, -2), - OPT_STRINGLIST("alang", audio_lang, 0), - OPT_STRINGLIST("slang", sub_lang, 0), + OPT_TRACKCHOICE("aid", stream_id[0][STREAM_AUDIO]), + OPT_TRACKCHOICE("vid", stream_id[0][STREAM_VIDEO]), + OPT_TRACKCHOICE("sid", stream_id[0][STREAM_SUB]), + OPT_TRACKCHOICE("secondary-sid", stream_id[1][STREAM_SUB]), + OPT_TRACKCHOICE("ff-aid", stream_id_ff[STREAM_AUDIO]), + OPT_TRACKCHOICE("ff-vid", stream_id_ff[STREAM_VIDEO]), + OPT_TRACKCHOICE("ff-sid", stream_id_ff[STREAM_SUB]), + OPT_FLAG_STORE("no-sub", stream_id[0][STREAM_SUB], 0, -2), + OPT_FLAG_STORE("no-video", stream_id[0][STREAM_VIDEO], 0, -2), + OPT_FLAG_STORE("no-audio", stream_id[0][STREAM_AUDIO], 0, -2), + OPT_STRINGLIST("alang", stream_lang[STREAM_AUDIO], 0), + OPT_STRINGLIST("slang", stream_lang[STREAM_SUB], 0), OPT_CHOICE("audio-display", audio_display, 0, ({"no", 0}, {"attachment", 1})), @@ -730,13 +730,15 @@ const struct MPOpts mp_default_opts = { .consolecontrols = 1, .play_frames = -1, .keep_open = 0, - .audio_id = -1, - .video_id = -1, - .sub_id = -1, - .audio_id_ff = -1, - .video_id_ff = -1, - .sub_id_ff = -1, - .sub2_id = -2, + .stream_id = { { [STREAM_AUDIO] = -1, + [STREAM_VIDEO] = -1, + [STREAM_SUB] = -1, }, + { [STREAM_AUDIO] = -2, + [STREAM_VIDEO] = -2, + [STREAM_SUB] = -2, }, }, + .stream_id_ff = { [STREAM_AUDIO] = -1, + [STREAM_VIDEO] = -1, + [STREAM_SUB] = -1, }, .audio_display = 1, .sub_visibility = 1, .sub_pos = 100, |