diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-10-12 12:11:32 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-10-12 12:22:17 +0200 |
commit | 7c07da57e3797b26c6e896bd27afc2ed7d639a18 (patch) | |
tree | 1c2a545cdcecfb5dcab05e06306d471c3ae7a1fe /audio/out/ao_coreaudio_device.c | |
parent | 240266d12c543c705311ec98615110e08a07933b (diff) | |
download | mpv-7c07da57e3797b26c6e896bd27afc2ed7d639a18.tar.bz2 mpv-7c07da57e3797b26c6e896bd27afc2ed7d639a18.tar.xz |
coreaudio: use the new device selection API
The CoreAudio API is built around device IDs so we store the integer as string
and read it back.
Diffstat (limited to 'audio/out/ao_coreaudio_device.c')
-rw-r--r-- | audio/out/ao_coreaudio_device.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/audio/out/ao_coreaudio_device.c b/audio/out/ao_coreaudio_device.c index 0c908d52ef..49560a2e80 100644 --- a/audio/out/ao_coreaudio_device.c +++ b/audio/out/ao_coreaudio_device.c @@ -333,10 +333,6 @@ struct priv { bool changed_mixing; int stream_asbd_changed; bool muted; - - // options - int opt_device_id; - int opt_list; }; static int get_ring_size(struct ao *ao) @@ -402,9 +398,7 @@ static int init(struct ao *ao) { struct priv *p = ao->priv; - if (p->opt_list) ca_print_device_list(ao); - - OSStatus err = ca_select_device(ao, p->opt_device_id, &p->device); + OSStatus err = ca_select_device(ao, ao->device, &p->device); CHECK_CA_ERROR("failed to select device"); ao->format = af_fmt_from_planar(ao->format); @@ -660,6 +654,7 @@ const struct ao_driver audio_out_coreaudio_exclusive = { .reset = reset, .pause = audio_pause, .resume = audio_resume, + .list_devs = ca_get_device_list, .priv_size = sizeof(struct priv), .priv_defaults = &(const struct priv){ .muted = false, @@ -669,9 +664,4 @@ const struct ao_driver audio_out_coreaudio_exclusive = { .stream_idx = -1, .changed_mixing = false, }, - .options = (const struct m_option[]) { - OPT_INT("device_id", opt_device_id, 0, OPTDEF_INT(-1)), - OPT_FLAG("list", opt_list, 0), - {0} - }, }; |