From c0a5c0655ab2f0a887618d6b36778ece6c5e775c Mon Sep 17 00:00:00 2001 From: Thijs Vermeir Date: Fri, 2 Nov 2007 14:59:06 +0000 Subject: [PATCH] tests/check/elements/audioconvert.c: Add check to make sure that the out caps have a channel layout set on them where... Original commit message from CVS: Patch by: Thijs Vermeir * tests/check/elements/audioconvert.c: (verify_convert): Add check to make sure that the out caps have a channel layout set on them where they should have one. --- ChangeLog | 8 ++++++++ tests/check/elements/audioconvert.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7b74642999..9dbae10a63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-11-02 Tim-Philipp Müller + + Patch by: Thijs Vermeir + + * tests/check/elements/audioconvert.c: (verify_convert): + Add check to make sure that the out caps have a channel layout + set on them where they should have one. + 2007-11-01 Tim-Philipp Müller Patch by: Vincent Torri diff --git a/tests/check/elements/audioconvert.c b/tests/check/elements/audioconvert.c index 7bc750ab1d..5624a91fc1 100644 --- a/tests/check/elements/audioconvert.c +++ b/tests/check/elements/audioconvert.c @@ -336,6 +336,25 @@ verify_convert (const gchar * which, void *in, int inlength, } fail_unless (memcmp (GST_BUFFER_DATA (outbuffer), out, outlength) == 0, "failed converting %s", which); + + /* make sure that the channel positions are not lost */ + { + GstStructure *in_s, *out_s; + gint out_chans; + + in_s = gst_caps_get_structure (incaps, 0); + out_s = gst_caps_get_structure (GST_BUFFER_CAPS (outbuffer), 0); + fail_unless (gst_structure_get_int (out_s, "channels", &out_chans)); + + /* positions for 1 and 2 channels are implicit if not provided */ + if (out_chans > 2 && gst_structure_has_field (in_s, "channel-positions")) { + if (!gst_structure_has_field (out_s, "channel-positions")) { + g_error ("Channel layout got lost somewhere:\n\nIns : %s\nOuts: %s\n", + gst_structure_to_string (in_s), gst_structure_to_string (out_s)); + } + } + } + buffers = g_list_remove (buffers, outbuffer); gst_buffer_unref (outbuffer); fail_unless (gst_element_set_state (audioconvert,