summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavard Graff <havard.graff@gmail.com>2015-07-16 17:53:40 +0200
committerTim-Philipp Müller <tim@centricular.com>2015-07-16 17:09:27 +0100
commit0841b2a97ed031edc3c9d221fdf77ac7f0020b43 (patch)
tree5b440550b3874440c497441f800e25f2d7f60ae0
parent8597284d0be697bffbdb9f31a0f4e6576bc0a73f (diff)
harness: don't re-establish the harness sink and src pads
Given that the element has the possibility to have one, they should already be there. https://bugzilla.gnome.org/show_bug.cgi?id=752498
-rw-r--r--libs/gst/check/gstharness.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c
index 00f36ba47..f61163f7b 100644
--- a/libs/gst/check/gstharness.c
+++ b/libs/gst/check/gstharness.c
@@ -483,6 +483,7 @@ gst_harness_setup_src_pad (GstHarness * h,
{
GstHarnessPrivate *priv = h->priv;
g_assert (src_tmpl);
+ g_assert (h->srcpad == NULL);
priv->src_event_queue =
g_async_queue_new_full ((GDestroyNotify) gst_event_unref);
@@ -507,6 +508,7 @@ gst_harness_setup_sink_pad (GstHarness * h,
{
GstHarnessPrivate *priv = h->priv;
g_assert (sink_tmpl);
+ g_assert (h->sinkpad == NULL);
priv->buffer_queue = g_async_queue_new_full (
(GDestroyNotify) gst_buffer_unref);
@@ -956,7 +958,8 @@ void
gst_harness_add_element_src_pad (GstHarness * h, GstPad * srcpad)
{
GstHarnessPrivate *priv = h->priv;
- gst_harness_setup_sink_pad (h, &hsinktemplate, NULL);
+ if (h->sinkpad == NULL)
+ gst_harness_setup_sink_pad (h, &hsinktemplate, NULL);
g_assert_cmpint (gst_pad_link (srcpad, h->sinkpad), ==, GST_PAD_LINK_OK);
g_free (priv->element_srcpad_name);
priv->element_srcpad_name = gst_pad_get_name (srcpad);
@@ -977,7 +980,8 @@ void
gst_harness_add_element_sink_pad (GstHarness * h, GstPad * sinkpad)
{
GstHarnessPrivate *priv = h->priv;
- gst_harness_setup_src_pad (h, &hsrctemplate, NULL);
+ if (h->srcpad == NULL)
+ gst_harness_setup_src_pad (h, &hsrctemplate, NULL);
g_assert_cmpint (gst_pad_link (h->srcpad, sinkpad), ==, GST_PAD_LINK_OK);
g_free (priv->element_sinkpad_name);
priv->element_sinkpad_name = gst_pad_get_name (sinkpad);