summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-09 18:06:26 +0200
committerwm4 <wm4@nowhere>2013-05-12 21:24:57 +0200
commitecc6e379b24dd5e37b864ae599a154880a2bd2d0 (patch)
treef439d10380a5f234b660cabb236470cabb1d4d0d /audio/out/ao_coreaudio.c
parentab8f28a672fbd8d21a98c265976068e80be082a7 (diff)
downloadmpv-ecc6e379b24dd5e37b864ae599a154880a2bd2d0.tar.bz2
mpv-ecc6e379b24dd5e37b864ae599a154880a2bd2d0.tar.xz
audio/out: channel map selection
Make all AOs use what has been introduced in the previous commit. Note that even AOs which can handle all possible layouts (like ao_null) use the new functions. This might be important if in the future ao_select_champ() possibly honors global user options about downmixing and so on.
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r--audio/out/ao_coreaudio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index a3c6907ed4..6a15690074 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -499,6 +499,11 @@ int device_id, display_help = 0;
// Save selected device id
ao->i_selected_dev = devid_def;
+ struct mp_chmap_sel chmap_sel = {0};
+ mp_chmap_sel_add_waveext(&chmap_sel);
+ if (!ao_chmap_sel_adjust(&ao_data, &ao_data.channels, &chmap_sel))
+ goto err_out;
+
// Build Description for the input format
inDesc.mSampleRate=rate;
inDesc.mFormatID=ao->b_supports_digital ? kAudioFormat60958AC3 : kAudioFormatLinearPCM;
@@ -605,8 +610,8 @@ int device_id, display_help = 0;
ao->chunk_size = maxFrames;//*inDesc.mBytesPerFrame;
ao_data.samplerate = inDesc.mSampleRate;
- mp_chmap_from_channels(&ao_data.channels, inDesc.mChannelsPerFrame);
- mp_chmap_reorder_to_waveext(&ao_data.channels);
+ if (!ao_chmap_sel_get_def(&ao_data, &chmap_sel, &ao_data.channels, inDesc.mChannelsPerFrame))
+ goto err_out2;
ao_data.bps = ao_data.samplerate * inDesc.mBytesPerFrame;
ao_data.outburst = ao->chunk_size;
ao_data.buffersize = ao_data.bps;
@@ -838,7 +843,7 @@ static int OpenSPDIF(void)
ao->chunk_size = ao->stream_format.mBytesPerPacket;
ao_data.samplerate = ao->stream_format.mSampleRate;
- // Applies default ordering; ok becazse AC3 data is always in mpv internal channel order
+ // Applies default ordering; ok because AC3 data is always in mpv internal channel order
mp_chmap_from_channels(&ao_data.channels, ao->stream_format.mChannelsPerFrame);
ao_data.bps = ao_data.samplerate * (ao->stream_format.mBytesPerPacket/ao->stream_format.mFramesPerPacket);
ao_data.outburst = ao->chunk_size;