summaryrefslogtreecommitdiffstats
path: root/audio/format.h
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/format.h
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/format.h')
-rw-r--r--audio/format.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/audio/format.h b/audio/format.h
index c4afe7a428..a14d8fe367 100644
--- a/audio/format.h
+++ b/audio/format.h
@@ -101,12 +101,8 @@ enum af_format {
AF_FORMAT_DOUBLE_LE = (AF_FORMAT_F|AF_FORMAT_64BIT|AF_FORMAT_LE),
AF_FORMAT_DOUBLE_BE = (AF_FORMAT_F|AF_FORMAT_64BIT|AF_FORMAT_BE),
- AF_FORMAT_AC3_LE = (AF_FORMAT_S_AC3|AF_FORMAT_16BIT|AF_FORMAT_LE),
- AF_FORMAT_AC3_BE = (AF_FORMAT_S_AC3|AF_FORMAT_16BIT|AF_FORMAT_BE),
-
- AF_FORMAT_IEC61937_LE = (AF_FORMAT_S_IEC61937|AF_FORMAT_16BIT|AF_FORMAT_LE),
- AF_FORMAT_IEC61937_BE = (AF_FORMAT_S_IEC61937|AF_FORMAT_16BIT|AF_FORMAT_BE),
-
+ AF_FORMAT_AC3 = (AF_FORMAT_S_AC3|AF_FORMAT_16BIT|AF_FORMAT_LE),
+ AF_FORMAT_IEC61937 = (AF_FORMAT_S_IEC61937|AF_FORMAT_16BIT|AF_FORMAT_LE),
AF_FORMAT_MPEG2 = (AF_FORMAT_S_MPEG2),
// Planar variants
@@ -126,13 +122,10 @@ enum af_format {
AF_FORMAT_FLOAT = AF_SELECT_LE_BE(AF_FORMAT_FLOAT_LE, AF_FORMAT_FLOAT_BE),
AF_FORMAT_DOUBLE = AF_SELECT_LE_BE(AF_FORMAT_DOUBLE_LE, AF_FORMAT_DOUBLE_BE),
-
- AF_FORMAT_AC3 = AF_SELECT_LE_BE(AF_FORMAT_AC3_LE, AF_FORMAT_AC3_BE),
- AF_FORMAT_IEC61937 = AF_SELECT_LE_BE(AF_FORMAT_IEC61937_LE, AF_FORMAT_IEC61937_BE),
};
#define AF_FORMAT_IS_AC3(fmt) \
- (((fmt) & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_S_AC3)
+ ((fmt) == AF_FORMAT_AC3)
#define AF_FORMAT_IS_IEC61937(fmt) \
(AF_FORMAT_IS_AC3(fmt) || \