From b174d647e5c50979b1931653642d863b08e940eb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 3 Jul 2013 19:00:18 +0200 Subject: ao_coreaudio: only set chmap_sel info for lpcm --- audio/out/ao_coreaudio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'audio') 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; -- cgit v1.2.3