Bug 777696: Fix gstreamer backend on big endian architectures. r=doublec
authorLandry Breuil <landry@openbsd.org>
Mon, 30 Jul 2012 17:57:15 +0200
changeset 100882 54a8f77d3d26c2c16f79af84036f2f2ca9530565
parent 100881 efc3fb215b231e1335277bd0d359668b2a488da6
child 100883 20b67f48676c6afd5353b5ca621e2980e43a1abe
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdoublec
bugs777696
milestone17.0a1
Bug 777696: Fix gstreamer backend on big endian architectures. r=doublec
content/media/gstreamer/nsGStreamerReader.cpp
--- a/content/media/gstreamer/nsGStreamerReader.cpp
+++ b/content/media/gstreamer/nsGStreamerReader.cpp
@@ -127,20 +127,28 @@ nsresult nsGStreamerReader::Init(nsBuilt
   GstPad *sinkpad = gst_element_get_pad(GST_ELEMENT(mVideoAppSink), "sink");
   gst_pad_add_event_probe(sinkpad,
       G_CALLBACK(&nsGStreamerReader::EventProbeCb), this);
   gst_object_unref(sinkpad);
 
   mAudioSink = gst_parse_bin_from_description("capsfilter name=filter ! "
 #ifdef MOZ_SAMPLE_TYPE_FLOAT32
         "appsink name=audiosink sync=true caps=audio/x-raw-float,"
+#ifdef IS_LITTLE_ENDIAN
         "channels={1,2},rate=44100,width=32,endianness=1234", TRUE, NULL);
 #else
+        "channels={1,2},rate=44100,width=32,endianness=4321", TRUE, NULL);
+#endif
+#else
         "appsink name=audiosink sync=true caps=audio/x-raw-int,"
+#ifdef IS_LITTLE_ENDIAN
         "channels={1,2},rate=48000,width=16,endianness=1234", TRUE, NULL);
+#else
+        "channels={1,2},rate=48000,width=16,endianness=4321", TRUE, NULL);
+#endif
 #endif
   mAudioAppSink = GST_APP_SINK(gst_bin_get_by_name(GST_BIN(mAudioSink),
         "audiosink"));
   gst_app_sink_set_callbacks(mAudioAppSink, &mSinkCallbacks,
       (gpointer) this, NULL);
   sinkpad = gst_element_get_pad(GST_ELEMENT(mAudioAppSink), "sink");
   gst_pad_add_event_probe(sinkpad,
       G_CALLBACK(&nsGStreamerReader::EventProbeCb), this);