diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-08-25 10:05:49 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-08-25 10:08:54 +0200 |
commit | f4ccf22e1695e89fb6fcf97f92fc492a2bdc5b97 (patch) | |
tree | 5f308b437f0d483e0f5268e8e282b44d921ad9df /audio | |
parent | 740f0f61d840255a02efcf392fece51486a59183 (diff) | |
download | mpv-f4ccf22e1695e89fb6fcf97f92fc492a2bdc5b97.tar.bz2 mpv-f4ccf22e1695e89fb6fcf97f92fc492a2bdc5b97.tar.xz |
coreaudio_device: fix overwriting of user input
Fixes #1030
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_coreaudio_device.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/audio/out/ao_coreaudio_device.c b/audio/out/ao_coreaudio_device.c index 047e094f61..cf9d312003 100644 --- a/audio/out/ao_coreaudio_device.c +++ b/audio/out/ao_coreaudio_device.c @@ -404,15 +404,6 @@ static int init(struct ao *ao) if (p->opt_list) ca_print_device_list(ao); - *p = (struct priv) { - .muted = false, - .stream_asbd_changed = 0, - .hog_pid = -1, - .stream = 0, - .stream_idx = -1, - .changed_mixing = false, - }; - OSStatus err = ca_select_device(ao, p->opt_device_id, &p->device); CHECK_CA_ERROR("failed to select device"); @@ -676,6 +667,14 @@ const struct ao_driver audio_out_coreaudio_exclusive = { .pause = audio_pause, .resume = audio_resume, .priv_size = sizeof(struct priv), + .priv_defaults = &(const struct priv){ + .muted = false, + .stream_asbd_changed = 0, + .hog_pid = -1, + .stream = 0, + .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), |