From 04efc92897dde7902cb8c40ea3b0c99c9742e026 Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Sun, 9 Aug 2009 01:27:01 +0100 Subject: 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. --- tests/check/elements/flvmux.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/check/elements/flvmux.c b/tests/check/elements/flvmux.c index 38bb6c1e..5df3e13b 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); -- cgit