There is a check for HAVE_BIGENDIAN when outputting the IEC 61937
stream. On big-endian systems the payload data is not byteswapped,
causing in effect the outputted payload data to be in a different byte
order on big-endian than on little-endian systems.
However, the IEC 61937 preamble (and the final odd byte if present) is
always outputted in the same byte order. This means that on big-endian
systems the headers have a different byte order than the payload,
preventing useful use of the output.
Fix that by outputting the data in a format suitable for sending to an
audio device in S16LE format by default. Output as big-endian (S16BE)
is added as an AVOption. This makes the muxer output the same on all
archs by default.
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
{"be","output in big-endian format (for use as s16be)",0,FF_OPT_TYPE_CONST,SPDIF_FLAG_BIGENDIAN,0,INT_MAX,AV_OPT_FLAG_ENCODING_PARAM,"spdif_flags"},
{"dtshd_rate","mux complete DTS frames in HD mode at the specified IEC958 rate (in Hz, default 0=disabled)",offsetof(IEC61937Context,dtshd_rate),FF_OPT_TYPE_INT,0,0,768000,AV_OPT_FLAG_ENCODING_PARAM},
{"dtshd_fallback_time","min secs to strip HD for after an overflow (-1: till the end, default 60)",offsetof(IEC61937Context,dtshd_fallback),FF_OPT_TYPE_INT,60,-1,INT_MAX,AV_OPT_FLAG_ENCODING_PARAM},
{NULL},
@ -477,6 +481,15 @@ static int spdif_write_trailer(AVFormatContext *s)