From 514af9fbd1e27b3cfd27598cc85c29d8159b89a0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Jul 2015 19:21:22 +0200 Subject: ao_coreaudio: add exclusive suboption --- DOCS/interface-changes.rst | 1 + DOCS/man/ao.rst | 5 +++++ audio/out/ao_coreaudio.c | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 5e6f2c7045..c0fe2cd7cb 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -20,6 +20,7 @@ Interface changes :: --- mpv 0.10.0 will be released --- + - add ao coreaudio exclusive suboption - add ``track-list/N/forced`` property - add audio-params/channel-count and ``audio-params-out/channel-count props. - add af volume replaygain-fallback suboption diff --git a/DOCS/man/ao.rst b/DOCS/man/ao.rst index 0beee3b06f..b3984e4450 100644 --- a/DOCS/man/ao.rst +++ b/DOCS/man/ao.rst @@ -170,6 +170,11 @@ Available audio output drivers are: setting in the ``Audio Devices`` dialog in the ``Audio MIDI Setup`` utility. Note that this does not effect the selected speaker setup. + ``exclusive`` + Use exclusive mode access. This merely redirects to + ``coreaudio_exclusive``, but should be preferred over using that AO + directly. + ``coreaudio_exclusive`` (Mac OS X only) Native Mac OS X audio output driver using direct device access and exclusive mode (bypasses the sound server). diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 07ccd17468..1cf38326a2 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -39,6 +39,7 @@ struct priv { AudioStreamID original_asbd_stream; int change_physical_format; + int exclusive; }; static int64_t ca_get_hardware_latency(struct ao *ao) { @@ -151,8 +152,8 @@ static int init(struct ao *ao) { struct priv *p = ao->priv; - if (!af_fmt_is_pcm(ao->format)) { - MP_WARN(ao, "detected IEC61937, redirecting to coreaudio_exclusive\n"); + if (!af_fmt_is_pcm(ao->format) || p->exclusive) { + MP_VERBOSE(ao, "redirecting to coreaudio_exclusive\n"); ao->redirect = "coreaudio_exclusive"; return CONTROL_ERROR; } @@ -423,6 +424,7 @@ const struct ao_driver audio_out_coreaudio = { .priv_size = sizeof(struct priv), .options = (const struct m_option[]){ OPT_FLAG("change-physical-format", change_physical_format, 0), + OPT_FLAG("exclusive", exclusive, 0), {0} }, }; -- cgit v1.2.3