diff options
author | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2013-07-20 20:33:49 -0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-22 02:42:38 +0200 |
commit | d42c3e51b41cc6d421ecefab146b80e9879fcf23 (patch) | |
tree | 1501076e2eb2d679a72a01b0ce8a87a453e8cee4 /audio/out | |
parent | 56274c6664fa38096a79dd92bfc42c6e9f67d94c (diff) | |
download | mpv-d42c3e51b41cc6d421ecefab146b80e9879fcf23.tar.bz2 mpv-d42c3e51b41cc6d421ecefab146b80e9879fcf23.tar.xz |
ao_wasapi: Fully convert to m_option API
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_wasapi.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index 7056f0d769..3413d0132f 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -28,7 +28,6 @@ #include <avrt.h> #include "config.h" -#include "core/subopt-helper.h" #include "core/m_option.h" #include "core/m_config.h" #include "audio/format.h" @@ -1086,17 +1085,6 @@ static void uninit(struct ao *ao, bool immed) mp_msg(MSGT_AO, MSGL_V, "ao-wasapi: uninit END!\n"); } -#define OPT_BASE_STRUCT wasapi_state -const struct m_sub_options ao_wasapi_conf = { - .opts = (m_option_t[]){ - OPT_FLAG("exclusive", opt_exclusive, 0), - OPT_FLAG("list", opt_list, 0), - OPT_STRING("device", opt_device, 0), - {NULL}, - }, - .size = sizeof(wasapi_state), -}; - static int init(struct ao *ao, char *params) { mp_msg(MSGT_AO, MSGL_V, "ao-wasapi: init!\n"); @@ -1104,16 +1092,9 @@ static int init(struct ao *ao, char *params) mp_chmap_sel_add_waveext(&sel); if (!ao_chmap_sel_adjust(ao, &sel, &ao->channels)) return -1; - struct wasapi_state *state = talloc_zero(ao, struct wasapi_state); - if (!state) - return -1; - ao->priv = (void *)state; + struct wasapi_state *state = (struct wasapi_state *)ao->priv; fill_VistaBlob(state); - struct m_config *cfg = m_config_simple(state); - m_config_register_options(cfg, ao_wasapi_conf.opts); - m_config_parse_suboptions(cfg, "wasapi", params); - if (state->opt_list) { enumerate_devices(); } @@ -1244,6 +1225,8 @@ static float get_delay(struct ao *ao) (float)state->format.Format.nAvgBytesPerSec; } +#define OPT_BASE_STRUCT struct wasapi_state + const struct ao_driver audio_out_wasapi = { .info = &(const struct ao_info) { "Windows WASAPI audio output (event mode)", @@ -1260,4 +1243,11 @@ const struct ao_driver audio_out_wasapi = { .pause = audio_pause, .resume = audio_resume, .reset = reset, + .priv_size = sizeof(wasapi_state), + .options = (const struct m_option[]) { + OPT_FLAG("exclusive", opt_exclusive, 0), + OPT_FLAG("list", opt_list, 0), + OPT_STRING("device", opt_device, 0), + {NULL}, + }, }; |