diff options
author | wm4 <wm4@nowhere> | 2015-06-26 15:49:52 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-26 15:58:11 +0200 |
commit | cd6d846b70afc366a6d353571f3b730f7698106a (patch) | |
tree | 5ad8502131b035b8b1a2ec439431c9b9dab4ebcf /audio/out/ao_coreaudio.c | |
parent | 8134a0601b0cafbd466bf2b44f15a8592ce7b05f (diff) | |
download | mpv-cd6d846b70afc366a6d353571f3b730f7698106a.tar.bz2 mpv-cd6d846b70afc366a6d353571f3b730f7698106a.tar.xz |
ao_coreaudio: support non-interleaved output
This saves us the trouble of interleaving the audio data for
no reason.
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r-- | audio/out/ao_coreaudio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index d3d2bf046e..b424e66661 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -77,11 +77,14 @@ static OSStatus render_cb_lpcm(void *ctx, AudioUnitRenderActionFlags *aflags, { struct ao *ao = ctx; struct priv *p = ao->priv; - AudioBuffer buf = buffer_list->mBuffers[0]; + void *planes[MP_NUM_CHANNELS] = {0}; + + for (int n = 0; n < ao->num_planes; n++) + planes[n] = buffer_list->mBuffers[n].mData; int64_t end = mp_time_us(); end += p->hw_latency_us + ca_get_latency(ts) + ca_frames_to_us(ao, frames); - ao_read_data(ao, &buf.mData, frames, end); + ao_read_data(ao, planes, frames, end); return noErr; } @@ -163,8 +166,6 @@ static int init(struct ao *ao) if (!ca_init_chmap(ao, p->device)) goto coreaudio_error; - ao->format = af_fmt_from_planar(ao->format); - AudioStreamBasicDescription asbd; ca_fill_asbd(ao, &asbd); |