summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-07-03 19:00:18 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-07-22 21:53:18 +0200
commitb174d647e5c50979b1931653642d863b08e940eb (patch)
tree9669aa7c249865ed4773b5c981adb9d5cd826f35
parent4d15f1bb60083d53a67f1e718ce6643631e3a8ce (diff)
downloadmpv-b174d647e5c50979b1931653642d863b08e940eb.tar.bz2
mpv-b174d647e5c50979b1931653642d863b08e940eb.tar.xz
ao_coreaudio: only set chmap_sel info for lpcm
-rw-r--r--audio/out/ao_coreaudio.c12
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;