diff options
author | wm4 <wm4@nowhere> | 2015-05-06 18:51:31 +0200 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-05-07 10:53:18 +0900 |
commit | 4002258b3ffb6b675b2aecb8fa18fae293b1cf09 (patch) | |
tree | 132956717ccb31e836c0738004c5a000498f7459 | |
parent | 3b471462eb4e9488d1c73241f298322a9bb1fc6d (diff) | |
download | mpv-4002258b3ffb6b675b2aecb8fa18fae293b1cf09.tar.bz2 mpv-4002258b3ffb6b675b2aecb8fa18fae293b1cf09.tar.xz |
ao_coreaudio_exclusive: explicitly check for spdif formats
(cherry picked from commit 1e1045b13ea4acbbd77dd52c4e0599f1517e6ac3)
-rw-r--r-- | audio/out/ao_coreaudio_exclusive.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c index 492e0189f9..e1108773aa 100644 --- a/audio/out/ao_coreaudio_exclusive.c +++ b/audio/out/ao_coreaudio_exclusive.c @@ -382,18 +382,15 @@ static int init(struct ao *ao) ao->format = af_fmt_from_planar(ao->format); - bool supports_digital = false; - /* Probe whether device support S/PDIF stream output if input is AC3 stream, - * or anything else IEC61937-framed. */ - if (AF_FORMAT_IS_IEC61937(ao->format)) { - if (ca_device_supports_digital(ao, p->device)) - supports_digital = true; + if (!AF_FORMAT_IS_IEC61937(ao->format)) { + MP_ERR(ao, "Only compressed formats are supported.\n"); + goto coreaudio_error_nounlock; } - if (!supports_digital) { + if (!ca_device_supports_digital(ao, p->device)) { MP_ERR(ao, "selected device doesn't support digital formats\n"); goto coreaudio_error_nounlock; - } // closes if (!supports_digital) + } // Build ASBD for the input format AudioStreamBasicDescription asbd; |