iec61937: incoherent endianness in payload
Order header based on specified endianness and not system endianness
Fix following bugzilla
https://bugzilla.gnome.org/show_bug.cgi?id=678021
https://bugzilla.gnome.org/show_bug.cgi?id=757258
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
diff --git a/gst-libs/gst/audio/gstaudioiec61937.c b/gst-libs/gst/audio/gstaudioiec61937.c
index 948325e..a192913 100644
--- a/gst-libs/gst/audio/gstaudioiec61937.c
+++ b/gst-libs/gst/audio/gstaudioiec61937.c
@@ -161,14 +161,16 @@
guint dst_n, const GstAudioRingBufferSpec * spec, gint endianness)
{
guint i, tmp;
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- guint8 zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6,
- seven = 7;
-#else
- /* We need to send the data byte-swapped */
- guint8 zero = 1, one = 0, two = 3, three = 2, four = 5, five = 4, six = 7,
- seven = 6;
-#endif
+ guint8 zero = 0, one = 1, two = 2, three = 3, four = 4, five = 5, six = 6;
+ guint8 seven = 7;
+
+ if (G_BYTE_ORDER != endianness) {
+ /* We need to send the data byte-swapped */
+ zero = one--;
+ two = three--;
+ four = five--;
+ six = seven--;
+ }
g_return_val_if_fail (src != NULL, FALSE);
g_return_val_if_fail (dst != NULL, FALSE);