qtmux: Don't require endianness field for 8 bit raw audio
authorJan Urbanski <wulczer@wulczer.org>
Tue, 4 Aug 2009 10:58:35 +0000 (12:58 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 12 Apr 2011 19:32:12 +0000 (20:32 +0100)
Fixes bug #590360.

gst/quicktime/gstqtmux.c

index ba155f6..f100196 100644 (file)
@@ -1553,10 +1553,16 @@ gst_qt_mux_audio_sink_set_caps (GstPad * pad, GstCaps * caps)
 
     if (!gst_structure_get_int (structure, "width", &width) ||
         !gst_structure_get_int (structure, "depth", &depth) ||
-        !gst_structure_get_boolean (structure, "signed", &sign) ||
-        !gst_structure_get_int (structure, "endianness", &endianness)) {
-      GST_DEBUG_OBJECT (qtmux,
-          "broken caps, width/depth/signed/endianness field missing");
+        !gst_structure_get_boolean (structure, "signed", &sign)) {
+      GST_DEBUG_OBJECT (qtmux, "broken caps, width/depth/signed field missing");
+      goto refuse_caps;
+    }
+
+    if (depth <= 8) {
+      endianness = G_BYTE_ORDER;
+    } else if (!gst_structure_get_boolean (structure,
+            "endianness", &endianness)) {
+      GST_DEBUG_OBJECT (qtmux, "broken caps, endianness field missing");
       goto refuse_caps;
     }