diff options
-rw-r--r-- | audio/out/ao_coreaudio.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 7f8949d7d9..8eed846144 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -308,11 +308,6 @@ static int init(struct ao *ao, char *params) // Save selected device id p->device = selected_device; - struct mp_chmap_sel chmap_sel = {0}; - mp_chmap_sel_add_waveext(&chmap_sel); - if (!ao_chmap_sel_adjust(ao, &chmap_sel, &ao->channels)) - goto coreaudio_error; - bool supports_digital = false; /* Probe whether device support S/PDIF stream output if input is AC3 stream. */ if (AF_FORMAT_IS_AC3(ao->format)) { @@ -320,6 +315,13 @@ static int init(struct ao *ao, char *params) supports_digital = true; } + if (!supports_digital) { + struct mp_chmap_sel chmap_sel = {0}; + mp_chmap_sel_add_waveext(&chmap_sel); + if (!ao_chmap_sel_adjust(ao, &chmap_sel, &ao->channels)) + goto coreaudio_error; + } + // Build ASBD for the input format AudioStreamBasicDescription asbd; asbd.mSampleRate = ao->samplerate; |