From d0636238519875fa25c5b544d6af54c96892d3fd Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Mon, 16 Sep 2013 08:31:47 +0200 Subject: [PATCH] tests: collectpads: tweak stub _collect to push all buffers https://bugzilla.gnome.org/show_bug.cgi?id=708416 --- tests/check/libs/collectpads.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/check/libs/collectpads.c b/tests/check/libs/collectpads.c index 19552c8..6de82d8 100644 --- a/tests/check/libs/collectpads.c +++ b/tests/check/libs/collectpads.c @@ -69,13 +69,24 @@ gst_agregator_collected (GstCollectPads * pads, gpointer user_data) { GstAggregator *aggregator = GST_AGGREGATOR (user_data); GstBuffer *inbuf; - GstCollectData *collect_data = (GstCollectData *) pads->data->data; - guint outsize = gst_collect_pads_available (pads); + GstCollectData *collect_data = NULL; + guint outsize = 0; + GSList *walk; + + walk = pads->data; + for (walk = pads->data; walk; walk = walk->next) { + GstCollectData *tmp = (GstCollectData *) walk->data; + if (tmp->buffer) { + collect_data = tmp; + break; + } + } /* can only happen when no pads to collect or all EOS */ - if (outsize == 0) + if (collect_data == NULL) goto eos; + outsize = gst_buffer_get_size (collect_data->buffer); inbuf = gst_collect_pads_take_buffer (pads, collect_data, outsize); if (!inbuf) goto eos; @@ -597,9 +608,6 @@ GST_START_TEST (test_collect_twice) /* now both pads have a buffer */ fail_unless_collected (TRUE); - fail_unless (outbuf1 == buf1); - fail_unless (outbuf2 == buf2); - /* these will return immediately as at this point the threads have been * unlocked and are finished */ g_thread_join (thread1); @@ -762,7 +770,7 @@ GST_START_TEST (test_branched_pipeline) gst_message_unref (msg); /* we have two branches, but we still only forward buffers from one branch */ - fail_unless_equals_int (count, NUM_BUFFERS); + fail_unless_equals_int (count, NUM_BUFFERS * 2); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (bus); -- 2.7.4