diff -Naurp -x .svn gst-plugins-base-orig/gst/audioconvert/audioconvert.c gst-plugins-base/gst/audioconvert/audioconvert.c
--- gst-plugins-base-orig/gst/audioconvert/audioconvert.c	2007-03-07 23:20:50.000000000 +0100
+++ gst-plugins-base/gst/audioconvert/audioconvert.c	2007-03-14 18:50:40.000000000 +0100
@@ -35,13 +35,59 @@
 /* sign bit in the intermediate format */
 #define SIGNED  (1U<<31)
 
+/* the float endianness conversion from gst/floatcast/floatcast.h is
+ * overly complex, we use our own. */
+
+static inline gfloat
+_gfloat_swap_le_be (gfloat f)
+{
+  union
+  {
+    guint32 i;
+    gfloat f;
+  } u;
+
+  u.f = f;
+  u.i = GUINT32_SWAP_LE_BE (u.i);
+  return u.f;
+}
+
+static inline gdouble
+_gdouble_swap_le_be (gdouble d)
+{
+  union
+  {
+    guint64 i;
+    gdouble d;
+  } u;
+
+  u.d = d;
+  u.i = GUINT64_SWAP_LE_BE (u.i);
+  return u.d;
+}
+
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define GFLOAT_LE(f) (f)
+#define GFLOAT_BE(f) (_gfloat_swap_le_be (f))
+#define GDOUBLE_LE(d) (d)
+#define GDOUBLE_BE(d) (_gdouble_swap_le_be (d))
+#elif G_BYTE_ORDER == G_BIG_ENDIAN
+#define GFLOAT_LE(f) (_gfloat_swap_le_be (f))
+#define GFLOAT_BE(f) (f)
+#define GDOUBLE_LE(d) (_gdouble_swap_le_be (d))
+#define GDOUBLE_BE(d) (d)
+#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
+#error unknown ENDIAN type
+#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
+
 /*** 
  * unpack code
  */
 #define MAKE_UNPACK_FUNC_NAME(name)                                     \
 audio_convert_unpack_##name
 
-#define MAKE_UNPACK_FUNC(name, stride, sign, READ_FUNC)                 \
+/* unpack from integer to signed integer 32 */
+#define MAKE_UNPACK_FUNC_II(name, stride, sign, READ_FUNC)              \
 static void                                                             \
 MAKE_UNPACK_FUNC_NAME (name) (guint8 *src, gint32 *dst,                 \
         gint scale, gint count)                                         \
@@ -52,44 +98,28 @@ MAKE_UNPACK_FUNC_NAME (name) (guint8 *sr
   }                                                                     \
 }
 
-/* special unpack code for float/double */
-static void
-MAKE_UNPACK_FUNC_NAME (float) (gfloat * src, gint32 * dst, gint s, gint count)
-{
-  gdouble temp;
-
-  for (; count; count--) {
-    /* blow up to 32 bit */
-    temp = (*src++ * 2147483647.0) + 0.5;
-    *dst++ = (gint32) CLAMP (temp, G_MININT32, G_MAXINT32);
-  }
-}
-
-static void
-MAKE_UNPACK_FUNC_NAME (double) (gdouble * src, gint32 * dst, gint s, gint count)
-{
-  gdouble temp;
-
-  for (; count; count--) {
-    /* blow up to 32 bit */
-    temp = (*src++ * 2147483647.0) + 0.5;
-    *dst++ = (gint32) CLAMP (temp, G_MININT32, G_MAXINT32);
-  }
-}
-
-static void
-MAKE_UNPACK_FUNC_NAME (float_hq) (gfloat * src, gdouble * dst, gint s,
-    gint count)
-{
-  for (; count; count--)
-    *dst++ = (gdouble) (*src++);
-}
-
-static void
-MAKE_UNPACK_FUNC_NAME (double_hq) (gdouble * src, gdouble * dst, gint s,
-    gint count)
-{
-  memcpy (dst, src, count * sizeof (gdouble));
+/* unpack from float to signed integer 32 */
+#define MAKE_UNPACK_FUNC_FI(name, type, READ_FUNC)                            \
+static void                                                                   \
+MAKE_UNPACK_FUNC_NAME (name) (type * src, gint32 * dst, gint s, gint count)   \
+{                                                                             \
+  gdouble temp;                                                               \
+                                                                              \
+  for (; count; count--) {                                                    \
+    /* blow up to 32 bit */                                                   \
+    temp = (READ_FUNC (*src++) * 2147483647.0) + 0.5;                         \
+    *dst++ = (gint32) CLAMP (temp, G_MININT32, G_MAXINT32);                   \
+  }                                                                           \
+}
+
+/* unpack from float to float 64 (double) */
+#define MAKE_UNPACK_FUNC_FF(name, type, FUNC)                                 \
+static void                                                                   \
+MAKE_UNPACK_FUNC_NAME (name) (type * src, gdouble * dst, gint s,              \
+    gint count)                                                               \
+{                                                                             \
+  for (; count; count--)                                                      \
+    *dst++ = (gdouble) FUNC (*src++);                                         \
 }
 
 #define READ8(p)          GST_READ_UINT8(p)
@@ -100,20 +130,31 @@ MAKE_UNPACK_FUNC_NAME (double_hq) (gdoub
 #define READ32_FROM_LE(p) GST_READ_UINT32_LE (p)
 #define READ32_FROM_BE(p) GST_READ_UINT32_BE (p)
 
-MAKE_UNPACK_FUNC (u8, 1, SIGNED, READ8);
-MAKE_UNPACK_FUNC (s8, 1, 0, READ8);
-MAKE_UNPACK_FUNC (u16_le, 2, SIGNED, READ16_FROM_LE);
-MAKE_UNPACK_FUNC (s16_le, 2, 0, READ16_FROM_LE);
-MAKE_UNPACK_FUNC (u16_be, 2, SIGNED, READ16_FROM_BE);
-MAKE_UNPACK_FUNC (s16_be, 2, 0, READ16_FROM_BE);
-MAKE_UNPACK_FUNC (u24_le, 3, SIGNED, READ24_FROM_LE);
-MAKE_UNPACK_FUNC (s24_le, 3, 0, READ24_FROM_LE);
-MAKE_UNPACK_FUNC (u24_be, 3, SIGNED, READ24_FROM_BE);
-MAKE_UNPACK_FUNC (s24_be, 3, 0, READ24_FROM_BE);
-MAKE_UNPACK_FUNC (u32_le, 4, SIGNED, READ32_FROM_LE);
-MAKE_UNPACK_FUNC (s32_le, 4, 0, READ32_FROM_LE);
-MAKE_UNPACK_FUNC (u32_be, 4, SIGNED, READ32_FROM_BE);
-MAKE_UNPACK_FUNC (s32_be, 4, 0, READ32_FROM_BE);
+MAKE_UNPACK_FUNC_II (u8, 1, SIGNED, READ8);
+MAKE_UNPACK_FUNC_II (s8, 1, 0, READ8);
+MAKE_UNPACK_FUNC_II (u16_le, 2, SIGNED, READ16_FROM_LE);
+MAKE_UNPACK_FUNC_II (s16_le, 2, 0, READ16_FROM_LE);
+MAKE_UNPACK_FUNC_II (u16_be, 2, SIGNED, READ16_FROM_BE);
+MAKE_UNPACK_FUNC_II (s16_be, 2, 0, READ16_FROM_BE);
+MAKE_UNPACK_FUNC_II (u24_le, 3, SIGNED, READ24_FROM_LE);
+MAKE_UNPACK_FUNC_II (s24_le, 3, 0, READ24_FROM_LE);
+MAKE_UNPACK_FUNC_II (u24_be, 3, SIGNED, READ24_FROM_BE);
+MAKE_UNPACK_FUNC_II (s24_be, 3, 0, READ24_FROM_BE);
+MAKE_UNPACK_FUNC_II (u32_le, 4, SIGNED, READ32_FROM_LE);
+MAKE_UNPACK_FUNC_II (s32_le, 4, 0, READ32_FROM_LE);
+MAKE_UNPACK_FUNC_II (u32_be, 4, SIGNED, READ32_FROM_BE);
+MAKE_UNPACK_FUNC_II (s32_be, 4, 0, READ32_FROM_BE);
+MAKE_UNPACK_FUNC_FI (float_le, gfloat, GFLOAT_LE);
+MAKE_UNPACK_FUNC_FI (float_be, gfloat, GFLOAT_BE);
+MAKE_UNPACK_FUNC_FI (double_le, gdouble, GDOUBLE_LE);
+MAKE_UNPACK_FUNC_FI (double_be, gdouble, GDOUBLE_BE);
+MAKE_UNPACK_FUNC_FF (float_hq_le, gfloat, GFLOAT_LE);
+MAKE_UNPACK_FUNC_FF (float_hq_be, gfloat, GFLOAT_BE);
+MAKE_UNPACK_FUNC_FF (double_hq_le, gdouble, GDOUBLE_LE);
+MAKE_UNPACK_FUNC_FF (double_hq_be, gdouble, GDOUBLE_BE);
+
+/* One of the double_hq_* functions generated above is ineffecient, but it's
+ * never used anyway.  The same is true for one of the s32_* functions. */
 
 /*** 
  * packing code
@@ -121,7 +162,8 @@ MAKE_UNPACK_FUNC (s32_be, 4, 0, READ32_F
 #define MAKE_PACK_FUNC_NAME(name)                                       \
 audio_convert_pack_##name
 
-#define MAKE_PACK_FUNC(name, stride, sign, WRITE_FUNC)                  \
+/* pack from signed integer 32 to integer */
+#define MAKE_PACK_FUNC_II(name, stride, sign, WRITE_FUNC)               \
 static void                                                             \
 MAKE_PACK_FUNC_NAME (name) (gint32 *src, gpointer dst,                  \
         gint scale, gint count)                                         \
@@ -135,35 +177,24 @@ MAKE_PACK_FUNC_NAME (name) (gint32 *src,
   }                                                                     \
 }
 
-/* special pack code for float/double */
-static void
-MAKE_PACK_FUNC_NAME (float) (gint32 * src, gfloat * dst, gint scale, gint count)
-{
-  for (; count; count--)
-    *dst++ = INT2FLOAT (*src++);
-}
-
-static void
-MAKE_PACK_FUNC_NAME (double) (gint32 * src, gdouble * dst, gint scale,
-    gint count)
-{
-  for (; count; count--) {
-    *dst++ = INT2DOUBLE (*src++);
-  }
-}
-
-static void
-MAKE_PACK_FUNC_NAME (float_hq) (gdouble * src, gfloat * dst, gint s, gint count)
-{
-  for (; count; count--)
-    *dst++ = (gfloat) (*src++);
+/* pack from signed integer 32 to float */
+#define MAKE_PACK_FUNC_IF(name, type, FUNC, FUNC2)                      \
+static void                                                             \
+MAKE_PACK_FUNC_NAME (name) (gint32 * src, type * dst, gint scale,       \
+    gint count)                                                         \
+{                                                                       \
+  for (; count; count--)                                                \
+    *dst++ = FUNC (FUNC2 (*src++));                                     \
 }
 
-static void
-MAKE_PACK_FUNC_NAME (double_hq) (gdouble * src, gdouble * dst, gint s,
-    gint count)
-{
-  memcpy (dst, src, count * sizeof (gdouble));
+/* pack from float 64 (double) to float */
+#define MAKE_PACK_FUNC_FF(name, type, FUNC)                             \
+static void                                                             \
+MAKE_PACK_FUNC_NAME (name) (gdouble * src, type * dst, gint s,          \
+    gint count)                                                         \
+{                                                                       \
+  for (; count; count--)                                                \
+    *dst++ = FUNC ((type) (*src++));                                    \
 }
 
 #define WRITE8(p, v)       GST_WRITE_UINT8 (p, v)
@@ -174,20 +205,30 @@ MAKE_PACK_FUNC_NAME (double_hq) (gdouble
 #define WRITE32_TO_LE(p,v) GST_WRITE_UINT32_LE (p, (guint32)(v))
 #define WRITE32_TO_BE(p,v) GST_WRITE_UINT32_BE (p, (guint32)(v))
 
-MAKE_PACK_FUNC (u8, 1, SIGNED, WRITE8);
-MAKE_PACK_FUNC (s8, 1, 0, WRITE8);
-MAKE_PACK_FUNC (u16_le, 2, SIGNED, WRITE16_TO_LE);
-MAKE_PACK_FUNC (s16_le, 2, 0, WRITE16_TO_LE);
-MAKE_PACK_FUNC (u16_be, 2, SIGNED, WRITE16_TO_BE);
-MAKE_PACK_FUNC (s16_be, 2, 0, WRITE16_TO_BE);
-MAKE_PACK_FUNC (u24_le, 3, SIGNED, WRITE24_TO_LE);
-MAKE_PACK_FUNC (s24_le, 3, 0, WRITE24_TO_LE);
-MAKE_PACK_FUNC (u24_be, 3, SIGNED, WRITE24_TO_BE);
-MAKE_PACK_FUNC (s24_be, 3, 0, WRITE24_TO_BE);
-MAKE_PACK_FUNC (u32_le, 4, SIGNED, WRITE32_TO_LE);
-MAKE_PACK_FUNC (s32_le, 4, 0, WRITE32_TO_LE);
-MAKE_PACK_FUNC (u32_be, 4, SIGNED, WRITE32_TO_BE);
-MAKE_PACK_FUNC (s32_be, 4, 0, WRITE32_TO_BE);
+MAKE_PACK_FUNC_II (u8, 1, SIGNED, WRITE8);
+MAKE_PACK_FUNC_II (s8, 1, 0, WRITE8);
+MAKE_PACK_FUNC_II (u16_le, 2, SIGNED, WRITE16_TO_LE);
+MAKE_PACK_FUNC_II (s16_le, 2, 0, WRITE16_TO_LE);
+MAKE_PACK_FUNC_II (u16_be, 2, SIGNED, WRITE16_TO_BE);
+MAKE_PACK_FUNC_II (s16_be, 2, 0, WRITE16_TO_BE);
+MAKE_PACK_FUNC_II (u24_le, 3, SIGNED, WRITE24_TO_LE);
+MAKE_PACK_FUNC_II (s24_le, 3, 0, WRITE24_TO_LE);
+MAKE_PACK_FUNC_II (u24_be, 3, SIGNED, WRITE24_TO_BE);
+MAKE_PACK_FUNC_II (s24_be, 3, 0, WRITE24_TO_BE);
+MAKE_PACK_FUNC_II (u32_le, 4, SIGNED, WRITE32_TO_LE);
+MAKE_PACK_FUNC_II (s32_le, 4, 0, WRITE32_TO_LE);
+MAKE_PACK_FUNC_II (u32_be, 4, SIGNED, WRITE32_TO_BE);
+MAKE_PACK_FUNC_II (s32_be, 4, 0, WRITE32_TO_BE);
+MAKE_PACK_FUNC_IF (float_le, gfloat, GFLOAT_LE, INT2FLOAT);
+MAKE_PACK_FUNC_IF (float_be, gfloat, GFLOAT_BE, INT2FLOAT);
+MAKE_PACK_FUNC_IF (double_le, gdouble, GDOUBLE_LE, INT2DOUBLE);
+MAKE_PACK_FUNC_IF (double_be, gdouble, GDOUBLE_BE, INT2DOUBLE);
+MAKE_PACK_FUNC_FF (float_hq_le, gfloat, GFLOAT_LE);
+MAKE_PACK_FUNC_FF (float_hq_be, gfloat, GFLOAT_BE);
+/* For double_hq, packing and unpacking is the same, so we reuse the unpacking
+ * functions here. */
+#define audio_convert_pack_double_hq_le MAKE_UNPACK_FUNC_NAME (double_hq_le)
+#define audio_convert_pack_double_hq_be MAKE_UNPACK_FUNC_NAME (double_hq_be)
 
 static AudioConvertUnpack unpack_funcs[] = {
   (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (u8),
@@ -206,10 +247,14 @@ static AudioConvertUnpack unpack_funcs[]
   (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (s32_le),
   (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (u32_be),
   (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (s32_be),
-  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (float),
-  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (double),
-  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (float_hq),
-  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (double_hq),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (float_le),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (float_be),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (double_le),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (double_be),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (float_hq_le),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (float_hq_be),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (double_hq_le),
+  (AudioConvertUnpack) MAKE_UNPACK_FUNC_NAME (double_hq_be),
 };
 
 static AudioConvertPack pack_funcs[] = {
@@ -229,10 +274,14 @@ static AudioConvertPack pack_funcs[] = {
   (AudioConvertPack) MAKE_PACK_FUNC_NAME (s32_le),
   (AudioConvertPack) MAKE_PACK_FUNC_NAME (u32_be),
   (AudioConvertPack) MAKE_PACK_FUNC_NAME (s32_be),
-  (AudioConvertPack) MAKE_PACK_FUNC_NAME (float),
-  (AudioConvertPack) MAKE_PACK_FUNC_NAME (double),
-  (AudioConvertPack) MAKE_PACK_FUNC_NAME (float_hq),
-  (AudioConvertPack) MAKE_PACK_FUNC_NAME (double_hq),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (float_le),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (float_be),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (double_le),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (double_be),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (float_hq_le),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (float_hq_be),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (double_hq_le),
+  (AudioConvertPack) MAKE_PACK_FUNC_NAME (double_hq_be),
 };
 
 static gint
@@ -246,7 +295,9 @@ audio_convert_get_func_index (AudioConve
     index += fmt->sign ? 1 : 0;
   } else {
     /* this is float/double */
-    index = (fmt->width == 32) ? 16 : 17;
+    index = 16;
+    index += (fmt->width == 32) ? 0 : 2;
+    index += (fmt->endianness == G_LITTLE_ENDIAN) ? 0 : 1;
   }
   return index;
 }
@@ -258,7 +309,7 @@ check_default (AudioConvertCtx * ctx, Au
     return (fmt->width == 32 && fmt->depth == 32 &&
         fmt->endianness == G_BYTE_ORDER && fmt->sign == TRUE);
   } else {
-    return (fmt->width == 64);
+    return (fmt->width == 64 && fmt->endianness == G_BYTE_ORDER);
   }
 }
 
@@ -293,12 +344,10 @@ audio_convert_prepare_context (AudioConv
   gst_channel_mix_setup_matrix (ctx);
 
   idx_in = audio_convert_get_func_index (in);
-  if (!(ctx->unpack = unpack_funcs[idx_in]))
-    goto not_supported;
+  ctx->unpack = unpack_funcs[idx_in];
 
   idx_out = audio_convert_get_func_index (out);
-  if (!(ctx->pack = pack_funcs[idx_out]))
-    goto not_supported;
+  ctx->pack = pack_funcs[idx_out];
 
   /* if both formats are float/double use double as intermediate format and
    * and switch mixing */
@@ -308,10 +357,10 @@ audio_convert_prepare_context (AudioConv
   } else {
     GST_INFO ("use float mixing");
     ctx->channel_mix = (AudioConvertMix) gst_channel_mix_mix_float;
-    if (!(ctx->unpack = unpack_funcs[idx_in + 2]))
-      goto not_supported;
-    if (!(ctx->pack = pack_funcs[idx_out + 2]))
-      goto not_supported;
+    /* Bump the pack/unpack function indices by 4 to use double as intermediary
+     * format (float_hq_*, double_hq_* functions).*/
+    ctx->unpack = unpack_funcs[idx_in + 4];
+    ctx->pack = pack_funcs[idx_out + 4];
   }
   GST_INFO ("unitsizes: %d -> %d", in->unit_size, out->unit_size);
 
@@ -329,12 +378,6 @@ audio_convert_prepare_context (AudioConv
   ctx->out_scale = (out->is_int) ? (32 - out->depth) : 0;
 
   return TRUE;
-
-not_supported:
-  {
-    GST_INFO ("missing pack/unpack function");
-    return FALSE;
-  }
 }
 
 gboolean
diff -Naurp -x .svn gst-plugins-base-orig/gst/audioconvert/gstaudioconvert.c gst-plugins-base/gst/audioconvert/gstaudioconvert.c
--- gst-plugins-base-orig/gst/audioconvert/gstaudioconvert.c	2007-03-07 23:20:50.000000000 +0100
+++ gst-plugins-base/gst/audioconvert/gstaudioconvert.c	2007-03-14 18:50:40.000000000 +0100
@@ -129,12 +129,12 @@ GST_STATIC_CAPS ( \
   "audio/x-raw-float, " \
     "rate = (int) [ 1, MAX ], " \
     "channels = (int) [ 1, 8 ], " \
-    "endianness = (int) BYTE_ORDER, " \
+    "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
     "width = (int) 64;" \
   "audio/x-raw-float, " \
     "rate = (int) [ 1, MAX ], " \
     "channels = (int) [ 1, 8 ], " \
-    "endianness = (int) BYTE_ORDER, " \
+    "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
     "width = (int) 32;" \
   "audio/x-raw-int, " \
     "rate = (int) [ 1, MAX ], " \
@@ -267,6 +267,11 @@ gst_audio_convert_parse_caps (const GstC
     goto no_values;
   if (!gst_structure_get_int (structure, "rate", &fmt->rate))
     goto no_values;
+  /* width != 8 needs an endianness field */
+  if (fmt->width != 8) {
+    if (!gst_structure_get_int (structure, "endianness", &fmt->endianness))
+      goto no_values;
+  }
 
   if (fmt->is_int) {
     /* int specific fields */
@@ -275,11 +280,6 @@ gst_audio_convert_parse_caps (const GstC
     if (!gst_structure_get_int (structure, "depth", &fmt->depth))
       goto no_values;
 
-    /* width != 8 can have an endianness field */
-    if (fmt->width != 8) {
-      if (!gst_structure_get_int (structure, "endianness", &fmt->endianness))
-        goto no_values;
-    }
     /* depth cannot be bigger than the width */
     if (fmt->depth > fmt->width)
       goto not_allowed;
@@ -379,31 +379,30 @@ set_structure_widths_32_and_64 (GstStruc
 static GstStructure *
 make_lossless_changes (GstStructure * s, gboolean isfloat)
 {
+  GValue list = { 0 };
+  GValue val = { 0 };
+  int i;
+  const gint endian[] = { G_LITTLE_ENDIAN, G_BIG_ENDIAN };
+  const gboolean booleans[] = { TRUE, FALSE };
+
+  g_value_init (&list, GST_TYPE_LIST);
+  g_value_init (&val, G_TYPE_INT);
+  for (i = 0; i < 2; i++) {
+    g_value_set_int (&val, endian[i]);
+    gst_value_list_append_value (&list, &val);
+  }
+  gst_structure_set_value (s, "endianness", &list);
+  g_value_unset (&val);
+  g_value_unset (&list);
+
   if (isfloat) {
-    /* float doesn't have a depth or signedness field and only supports a
-     * widths of 32/64 and native endianness */
+    /* float doesn't have a depth or signedness field and only supports widths
+     * of 32 and 64 bits */
     gst_structure_remove_field (s, "depth");
     gst_structure_remove_field (s, "signed");
     set_structure_widths_32_and_64 (s);
-    gst_structure_set (s, "endianness", G_TYPE_INT, G_BYTE_ORDER, NULL);
   } else {
-    /* int supports either endian, and signed or unsigned. GValues are a pain */
-    GValue list = { 0 };
-    GValue val = { 0 };
-    int i;
-    const gint endian[] = { G_LITTLE_ENDIAN, G_BIG_ENDIAN };
-    const gboolean booleans[] = { TRUE, FALSE };
-
-    g_value_init (&list, GST_TYPE_LIST);
-    g_value_init (&val, G_TYPE_INT);
-    for (i = 0; i < 2; i++) {
-      g_value_set_int (&val, endian[i]);
-      gst_value_list_append_value (&list, &val);
-    }
-    gst_structure_set_value (s, "endianness", &list);
-    g_value_unset (&val);
-    g_value_unset (&list);
-
+    /* int supports signed and unsigned. GValues are a pain */
     g_value_init (&list, GST_TYPE_LIST);
     g_value_init (&val, G_TYPE_BOOLEAN);
     for (i = 0; i < 2; i++) {
diff -Naurp -x .svn gst-plugins-base-orig/tests/check/elements/audioconvert.c gst-plugins-base/tests/check/elements/audioconvert.c
--- gst-plugins-base-orig/tests/check/elements/audioconvert.c	2007-03-07 23:20:41.000000000 +0100
+++ gst-plugins-base/tests/check/elements/audioconvert.c	2007-03-14 19:05:07.000000000 +0100
@@ -36,7 +36,7 @@ GstPad *mysrcpad, *mysinkpad;
   "audio/x-raw-float, " \
     "rate = (int) [ 1, MAX ], " \
     "channels = (int) [ 1, 8 ], " \
-    "endianness = (int) BYTE_ORDER, " \
+    "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
     "width = (int) { 32, 64 };" \
   "audio/x-raw-int, " \
     "rate = (int) [ 1, MAX ], " \
@@ -324,6 +324,8 @@ verify_convert (const gchar * which, voi
   fail_unless_equals_int (GST_BUFFER_SIZE (outbuffer), outlength);
 
   if (memcmp (GST_BUFFER_DATA (outbuffer), out, outlength) != 0) {
+    g_print ("\nInput data:\n");
+    gst_util_dump_mem (in, inlength);
     g_print ("\nConverted data:\n");
     gst_util_dump_mem (GST_BUFFER_DATA (outbuffer), outlength);
     g_print ("\nExpected data:\n");
@@ -475,22 +477,72 @@ GST_START_TEST (test_int_conversion)
 
 GST_END_TEST;
 
+static gfloat
+_gfloat_swap_le_be (gfloat f)
+{
+  union
+  {
+    guint32 i;
+    gfloat f;
+  } u;
+
+  u.f = f;
+  u.i = GUINT32_SWAP_LE_BE (u.i);
+  return u.f;
+}
+
+static gdouble
+_gdouble_swap_le_be (gdouble d)
+{
+  union
+  {
+    guint64 i;
+    gdouble d;
+  } u;
+
+  u.d = d;
+  u.i = GUINT64_SWAP_LE_BE (u.i);
+  return u.d;
+}
+
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define GFLOAT_LE(f) (f)
+#define GFLOAT_BE(f) (_gfloat_swap_le_be(f))
+#define GDOUBLE_LE(d) (d)
+#define GDOUBLE_BE(d) (_gdouble_swap_le_be(d))
+#elif G_BYTE_ORDER == G_BIG_ENDIAN
+#define GFLOAT_LE(f) (_gfloat_swap_le_be(f))
+#define GFLOAT_BE(f) (f)
+#define GDOUBLE_LE(d) (_gdouble_swap_le_be(d))
+#define GDOUBLE_BE(d) (d)
+#else
+#error unknown ENDIAN type
+#endif
 
 GST_START_TEST (test_float_conversion)
 {
   /* 32 float <-> 16 signed */
   /* NOTE: if audioconvert was doing dithering we'd have a problem */
   {
-    gfloat in[] = { 0.0, 1.0, -1.0, 0.5, -0.5, 1.1, -1.1 };
+    gfloat in_le[] = { GFLOAT_LE (0.0), GFLOAT_LE (1.0), GFLOAT_LE (-1.0),
+      GFLOAT_LE (0.5), GFLOAT_LE (-0.5), GFLOAT_LE (1.1), GFLOAT_LE (-1.1)
+    };
+    gfloat in_be[] = { GFLOAT_BE (0.0), GFLOAT_BE (1.0), GFLOAT_BE (-1.0),
+      GFLOAT_BE (0.5), GFLOAT_BE (-0.5), GFLOAT_BE (1.1), GFLOAT_BE (-1.1)
+    };
     gint16 out[] = { 0, 32767, -32768, 16384, -16384, 32767, -32768 };
 
     /* only one direction conversion, the other direction does
      * not produce exactly the same as the input due to floating
      * point rounding errors etc. */
-    RUN_CONVERSION ("32 float to 16 signed",
-        in, get_float_caps (1, "BYTE_ORDER", 32),
+    RUN_CONVERSION ("32 float le to 16 signed",
+        in_le, get_float_caps (1, "LITTLE_ENDIAN", 32),
+        out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
+    RUN_CONVERSION ("32 float be to 16 signed",
+        in_be, get_float_caps (1, "BIG_ENDIAN", 32),
         out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
   }
+
   {
     gint16 in[] = { 0, -32768, 16384, -16384 };
     gfloat out[] = { 0.0, -1.0, 0.5, -0.5 };
@@ -503,14 +555,22 @@ GST_START_TEST (test_float_conversion)
   /* 64 float <-> 16 signed */
   /* NOTE: if audioconvert was doing dithering we'd have a problem */
   {
-    gdouble in[] = { 0.0, 1.0, -1.0, 0.5, -0.5, 1.1, -1.1 };
+    gdouble in_le[] = { GDOUBLE_LE (0.0), GDOUBLE_LE (1.0), GDOUBLE_LE (-1.0),
+      GDOUBLE_LE (0.5), GDOUBLE_LE (-0.5), GDOUBLE_LE (1.1), GDOUBLE_LE (-1.1)
+    };
+    gdouble in_be[] = { GDOUBLE_BE (0.0), GDOUBLE_BE (1.0), GDOUBLE_BE (-1.0),
+      GDOUBLE_BE (0.5), GDOUBLE_BE (-0.5), GDOUBLE_BE (1.1), GDOUBLE_BE (-1.1)
+    };
     gint16 out[] = { 0, 32767, -32768, 16384, -16384, 32767, -32768 };
 
     /* only one direction conversion, the other direction does
      * not produce exactly the same as the input due to floating
      * point rounding errors etc. */
-    RUN_CONVERSION ("64 float to 16 signed",
-        in, get_float_caps (1, "BYTE_ORDER", 64),
+    RUN_CONVERSION ("64 float LE to 16 signed",
+        in_le, get_float_caps (1, "LITTLE_ENDIAN", 64),
+        out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
+    RUN_CONVERSION ("64 float BE to 16 signed",
+        in_be, get_float_caps (1, "BIG_ENDIAN", 64),
         out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
   }
   {
@@ -518,7 +578,7 @@ GST_START_TEST (test_float_conversion)
     gdouble out[] = { 0.0,
       4.6566128752457969e-10 * (gdouble) (-32768L << 16),       /* ~ -1.0 */
       4.6566128752457969e-10 * (gdouble) (16384L << 16),        /* ~ 0.5 */
-      4.6566128752457969e-10 * (gdouble) (-16384L << 16), /* ~ -0.5 */
+      4.6566128752457969e-10 * (gdouble) (-16384L << 16),       /* ~ -0.5 */
     };
 
     RUN_CONVERSION ("16 signed to 64 float",
@@ -530,7 +590,7 @@ GST_START_TEST (test_float_conversion)
     gdouble out[] = { 0.0,
       4.6566128752457969e-10 * (gdouble) (-1L << 31),   /* ~ -1.0 */
       4.6566128752457969e-10 * (gdouble) (1L << 30),    /* ~ 0.5 */
-      4.6566128752457969e-10 * (gdouble) (-1L << 30), /* ~ -0.5 */
+      4.6566128752457969e-10 * (gdouble) (-1L << 30),   /* ~ -0.5 */
     };
 
     RUN_CONVERSION ("32 signed to 64 float",
@@ -551,6 +611,42 @@ GST_START_TEST (test_float_conversion)
         out, get_float_caps (1, "BYTE_ORDER", 32),
         in, get_float_caps (1, "BYTE_ORDER", 64));
   }
+
+  /* 32-bit float little endian <-> big endian */
+  {
+    gfloat le[] = { GFLOAT_LE (0.0), GFLOAT_LE (1.0), GFLOAT_LE (-1.0),
+      GFLOAT_LE (0.5), GFLOAT_LE (-0.5)
+    };
+    gfloat be[] = { GFLOAT_BE (0.0), GFLOAT_BE (1.0), GFLOAT_BE (-1.0),
+      GFLOAT_BE (0.5), GFLOAT_BE (-0.5)
+    };
+
+    RUN_CONVERSION ("32 float LE to BE",
+        le, get_float_caps (1, "LITTLE_ENDIAN", 32),
+        be, get_float_caps (1, "BIG_ENDIAN", 32));
+
+    RUN_CONVERSION ("32 float BE to LE",
+        be, get_float_caps (1, "BIG_ENDIAN", 32),
+        le, get_float_caps (1, "LITTLE_ENDIAN", 32));
+  }
+
+  /* 64-bit float little endian <-> big endian */
+  {
+    gdouble le[] = { GDOUBLE_LE (0.0), GDOUBLE_LE (1.0), GDOUBLE_LE (-1.0),
+      GDOUBLE_LE (0.5), GDOUBLE_LE (-0.5)
+    };
+    gdouble be[] = { GDOUBLE_BE (0.0), GDOUBLE_BE (1.0), GDOUBLE_BE (-1.0),
+      GDOUBLE_BE (0.5), GDOUBLE_BE (-0.5)
+    };
+
+    RUN_CONVERSION ("64 float LE to BE",
+        le, get_float_caps (1, "LITTLE_ENDIAN", 64),
+        be, get_float_caps (1, "BIG_ENDIAN", 64));
+
+    RUN_CONVERSION ("64 float BE to LE",
+        be, get_float_caps (1, "BIG_ENDIAN", 64),
+        le, get_float_caps (1, "LITTLE_ENDIAN", 64));
+  }
 }
 
 GST_END_TEST;
