From 5b5a3d0c469fa5e282b60eb9ac2b7e4414640d80 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 23 Sep 2014 19:34:14 +0200 Subject: 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. --- audio/format.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'audio/format.h') 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) || \ -- cgit v1.2.3