summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_alsa.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-05 21:04:17 +0200
committerwm4 <wm4@nowhere>2016-09-05 21:04:17 +0200
commit4ab860cddc177047663bbe8940b0d34c621b6425 (patch)
treeb13ac6888948d4b5f132d03f3ac243ea7790db73 /audio/out/ao_alsa.c
parentcc813647d54843e4731cc36160f0c1e04e4b1404 (diff)
downloadmpv-4ab860cddc177047663bbe8940b0d34c621b6425.tar.bz2
mpv-4ab860cddc177047663bbe8940b0d34c621b6425.tar.xz
options: add a mechanism to make sub-option replacement slightly easier
Instead of requiring each VO or AO to manually add members to MPOpts and the global option table, make it possible to register them automatically via vo_driver/ao_driver.global_opts members. This avoids modifying options.c/options.h every time, including having to duplicate the exact ifdeffery used to enable a driver.
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r--audio/out/ao_alsa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index e780d349c2..c542bee030 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -60,7 +60,7 @@ struct ao_alsa_opts {
};
#define OPT_BASE_STRUCT struct ao_alsa_opts
-const struct m_sub_options ao_alsa_conf = {
+static const struct m_sub_options ao_alsa_conf = {
.opts = (const struct m_option[]) {
OPT_STRING("alsa-device", device, 0),
OPT_FLAG("alsa-resample", resample, 0),
@@ -1180,4 +1180,5 @@ const struct ao_driver audio_out_alsa = {
OPT_SUBOPT_LEGACY("ignore-chmap", "alsa-ignore-chmap"),
{0}
},
+ .global_opts = &ao_alsa_conf,
};