summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio_device.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-23 19:34:14 +0200
committerwm4 <wm4@nowhere>2014-09-23 19:34:14 +0200
commit5b5a3d0c469fa5e282b60eb9ac2b7e4414640d80 (patch)
tree76c5f217ee981d969627e2e26f924e2ade1684d9 /audio/out/ao_coreaudio_device.c
parent1f4a74cbed9a631fc86d332e0869decb47f33be2 (diff)
downloadmpv-5b5a3d0c469fa5e282b60eb9ac2b7e4414640d80.tar.bz2
mpv-5b5a3d0c469fa5e282b60eb9ac2b7e4414640d80.tar.xz
audio: remove swapped-endian spdif formats
IEC 61937 frames should always be little endian (little endian 16 bit words). I don't see any apparent need why the audio chain should handle swapped-endian formats. It could be that some audio outputs might want them (especially on big endian architectures). On the other hand, it's not clear how that works on these architectures, and it's not even known whether the current code works on big endian at all. If something should break, and it should turn out that swapped-endian spdif is needed on any platform/AO, swapping still could be done in-place within the affected AO, and there's no need for the additional complexity in the rest of the player. Note that af_lavcac3enc outputs big endian spdif frames for unknown reasons. Normally, the resulting data is just pulled through an auto- inserted conversion filter and turned into little endian. Maybe this was done as a trick so that the code didn't have to byte-swap the actual audio frame. In any case, just make it output little endian frames. All of this is untested, because I have no receiver hardware.
Diffstat (limited to 'audio/out/ao_coreaudio_device.c')
-rw-r--r--audio/out/ao_coreaudio_device.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/audio/out/ao_coreaudio_device.c b/audio/out/ao_coreaudio_device.c
index cf9d312003..3ba1f0ce37 100644
--- a/audio/out/ao_coreaudio_device.c
+++ b/audio/out/ao_coreaudio_device.c
@@ -521,14 +521,7 @@ static int init_digital(struct ao *ao, AudioStreamBasicDescription asbd)
err = ca_enable_device_listener(p->device, changed);
CHECK_CA_ERROR("cannot install format change listener during init");
-#if BYTE_ORDER == BIG_ENDIAN
- if (!(p->stream_asdb.mFormatFlags & kAudioFormatFlagIsBigEndian))
-#else
- /* tell mplayer that we need a byteswap on AC3 streams, */
- if (p->stream_asbd.mFormatID & kAudioFormat60958AC3)
- ao->format = AF_FORMAT_AC3_LE;
- else if (p->stream_asbd.mFormatFlags & kAudioFormatFlagIsBigEndian)
-#endif
+ if (p->stream_asdb.mFormatFlags & kAudioFormatFlagIsBigEndian)
MP_WARN(ao, "stream has non-native byte order, output may fail\n");
ao->samplerate = p->stream_asbd.mSampleRate;