tests: fix metadata not writable warnings in interleave and deinterleave tests
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 11 Mar 2010 15:51:40 +0000 (15:51 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 11 Mar 2010 15:51:40 +0000 (15:51 +0000)
tests/check/elements/deinterleave.c
tests/check/elements/interleave.c

index 5a5c3f2..3a0eb0c 100644 (file)
@@ -401,15 +401,14 @@ src_handoff_float32_8ch (GstElement * src, GstBuffer * buf, GstPad * pad,
   GST_BUFFER_OFFSET (buf) = 0;
   GST_BUFFER_TIMESTAMP (buf) = 0;
 
+  GST_BUFFER_CAPS (buf) = caps;
+
   for (i = 0; i < SAMPLES_PER_BUFFER; ++i) {
     for (c = 0; c < NUM_CHANNELS; ++c) {
       *data = (gfloat) ((i * NUM_CHANNELS) + c);
       ++data;
     }
   }
-
-  gst_buffer_set_caps (buf, caps);
-  gst_caps_unref (caps);
 }
 
 static gboolean
index e2fb558..081fad7 100644 (file)
@@ -377,11 +377,8 @@ src_handoff_float32 (GstElement * element, GstBuffer * buffer, GstPad * pad,
     gpointer user_data)
 {
   gint n = GPOINTER_TO_INT (user_data);
-
   GstCaps *caps;
-
   gfloat *data;
-
   gint i;
 
   if (GST_PAD_CAPS (pad))
@@ -414,8 +411,7 @@ src_handoff_float32 (GstElement * element, GstBuffer * buffer, GstPad * pad,
   GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE;
   GST_BUFFER_DURATION (buffer) = GST_SECOND;
 
-  gst_buffer_set_caps (buffer, caps);
-  gst_caps_unref (caps);
+  GST_BUFFER_CAPS (buffer) = caps;
 
   for (i = 0; i < 48000; i++)
     data[i] = (n % 2 == 0) ? -1.0 : 1.0;
@@ -426,11 +422,8 @@ sink_handoff_float32 (GstElement * element, GstBuffer * buffer, GstPad * pad,
     gpointer user_data)
 {
   gint i;
-
   gfloat *data;
-
   GstCaps *caps;
-
   gint n = GPOINTER_TO_INT (user_data);
 
   fail_unless (GST_IS_BUFFER (buffer));