encodebin: Requesting a pad again now gives a g_return_val_if_fail()
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 29 Mar 2011 13:41:33 +0000 (15:41 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 29 Mar 2011 13:42:50 +0000 (15:42 +0200)
Before the behaviour was undefined and implemented differently by elements,
now core checks for this (and other problems) and returns NULL and an assertion.

tests/check/elements/encodebin.c

index 03ff262..0d0d009 100644 (file)
@@ -504,7 +504,8 @@ GST_START_TEST (test_encodebin_render_audio_only_static)
   fail_unless (gst_element_link_many (audiotestsrc, ebin, fakesink, NULL));
 
   /* Requesting a new pad should fail */
-  fail_if (gst_element_get_request_pad (ebin, "audio_0") != NULL);
+  ASSERT_CRITICAL (gst_element_get_request_pad (ebin, "audio_0"));
+
   sinkcaps = gst_caps_new_simple ("audio/x-raw-int", NULL);
   g_signal_emit_by_name (ebin, "request-pad", sinkcaps, &sinkpad);
   gst_caps_unref (sinkcaps);