diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-09 01:27:01 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-09 01:28:40 +0100 |
commit | 04efc92897dde7902cb8c40ea3b0c99c9742e026 (patch) | |
tree | e6402e189bf34b177d3c916db7c93ebfb9b96032 /tests | |
parent | 19b7001bf99ea37a91af6061ca98e50b08064017 (diff) |
check: fix flvmux unit test on big endian machines
flvmux only accepts raw audio in little endian, but audiotestsrc
produces audio in the native endianness, which makes linking
between audiotestsrc and flvmux fail on big endian machines. Add
an audioconvert element in between the two to fix this.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/flvmux.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/check/elements/flvmux.c b/tests/check/elements/flvmux.c index 38bb6c1e0..5df3e13ba 100644 --- a/tests/check/elements/flvmux.c +++ b/tests/check/elements/flvmux.c @@ -49,7 +49,7 @@ handoff_cb (GstElement * element, GstBuffer * buf, GstPad * pad, static void mux_pcm_audio (guint num_buffers, guint repeat) { - GstElement *src, *sink, *flvmux, *pipeline; + GstElement *src, *sink, *flvmux, *conv, *pipeline; gint counter; GST_LOG ("num_buffers = %u", num_buffers); @@ -66,6 +66,9 @@ mux_pcm_audio (guint num_buffers, guint repeat) g_object_set (src, "num-buffers", num_buffers, NULL); + conv = gst_element_factory_make ("audioconvert", "audioconvert"); + fail_unless (conv != NULL, "Failed to create 'audioconvert' element!"); + flvmux = gst_element_factory_make ("flvmux", "flvmux"); fail_unless (flvmux != NULL, "Failed to create 'flvmux' element!"); @@ -75,8 +78,9 @@ mux_pcm_audio (guint num_buffers, guint repeat) g_object_set (sink, "signal-handoffs", TRUE, NULL); g_signal_connect (sink, "handoff", G_CALLBACK (handoff_cb), &counter); - gst_bin_add_many (GST_BIN (pipeline), src, flvmux, sink, NULL); + gst_bin_add_many (GST_BIN (pipeline), src, conv, flvmux, sink, NULL); + fail_unless (gst_element_link (src, conv)); fail_unless (gst_element_link (flvmux, sink)); do { @@ -90,8 +94,8 @@ mux_pcm_audio (guint num_buffers, guint repeat) sinkpad = gst_element_get_request_pad (flvmux, "audio"); fail_unless (sinkpad != NULL, "Could not get audio request pad"); - srcpad = gst_element_get_static_pad (src, "src"); - fail_unless (srcpad != NULL, "Could not get audiotestsrc's source pad"); + srcpad = gst_element_get_static_pad (conv, "src"); + fail_unless (srcpad != NULL, "Could not get audioconvert's source pad"); fail_unless_equals_int (gst_pad_link (srcpad, sinkpad), GST_PAD_LINK_OK); |