{
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;
/* 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);
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);