diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-06-26 08:23:31 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-07-22 21:53:17 +0200 |
commit | 88425625cf1e746267d0f6b3cbcc4ef42d119a1d (patch) | |
tree | e84cd43bc37967dbbb59e0c86abd87457c97bca5 /audio/out | |
parent | 065e446e040b679cb70ab20a31d9bd17385f75ce (diff) | |
download | mpv-88425625cf1e746267d0f6b3cbcc4ef42d119a1d.tar.bz2 mpv-88425625cf1e746267d0f6b3cbcc4ef42d119a1d.tar.xz |
ao_coreaudio: refactor play
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_coreaudio.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 32521b4ccf..776a7caf82 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -38,6 +38,7 @@ #include "ao.h" #include "audio/format.h" +#include "osdep/timer.h" #include "core/subopt-helper.h" #include "core/mp_ring.h" @@ -563,29 +564,20 @@ coreaudio_error: static int play(struct ao *ao, void *output_samples, int num_bytes, int flags) { - struct priv *p = ao->priv; + struct priv *p = ao->priv; struct priv_d *d = p->digital; // Check whether we need to reset the digital output stream. if (p->b_digital && d->b_stream_format_changed) { d->b_stream_format_changed = 0; - int b_digital = AudioStreamSupportsDigital(d->i_stream_id); - if (b_digital) { - /* Current stream supports digital format output, let's set it. */ - ca_msg(MSGL_V, - "Detected current stream supports digital, try to restore digital output...\n"); - - if (!AudioStreamChangeFormat(d->i_stream_id, d->stream_format)) - ca_msg(MSGL_WARN, - "Restoring digital output failed.\n"); - else { - ca_msg(MSGL_WARN, - "Restoring digital output succeeded.\n"); + if (AudioStreamSupportsDigital(d->i_stream_id)) { + if (!AudioStreamChangeFormat(d->i_stream_id, d->stream_format)) { + ca_msg(MSGL_WARN, "can't restore digital output\n"); + } else { + ca_msg(MSGL_WARN, "Restoring digital output succeeded.\n"); reset(ao); } - } else - ca_msg(MSGL_V, - "Detected current stream does not support digital.\n"); + } } int wrote = mp_ring_write(p->buffer, output_samples, num_bytes); |