tests: multiqueue: fix eos count on test for not-linked case

From the test case:

/* This test creates a multiqueue with 2 streams. One receives
 * a constant flow of buffers, the other only gets one buffer, and then
 * new-segment events, and returns not-linked. The multiqueue should not fill.
 */

If one of the queues goes EOS and the other returns NOT_LINKED the stream
can be considerered EOS as a NOT_LINKED means that one of the branches has no
sink downstream that will block the EOS message posting.

https://bugzilla.gnome.org/show_bug.cgi?id=725917
This commit is contained in:
Thiago Santos 2014-03-14 13:32:17 -03:00
parent 3de939cb5b
commit 22258782d8

View file

@ -389,6 +389,7 @@ mq_dummypad_event (GstPad * sinkpad, GstObject * parent, GstEvent * event)
g_mutex_lock (pad_data->mutex); g_mutex_lock (pad_data->mutex);
/* Accumulate that we've seen the EOS and signal the main thread */ /* Accumulate that we've seen the EOS and signal the main thread */
if (pad_data->eos_count_ptr)
*(pad_data->eos_count_ptr) += 1; *(pad_data->eos_count_ptr) += 1;
GST_DEBUG ("EOS on pad %u", pad_data->pad_num); GST_DEBUG ("EOS on pad %u", pad_data->pad_num);
@ -634,7 +635,10 @@ GST_START_TEST (test_sparse_stream)
pad_data[i].pad_num = i; pad_data[i].pad_num = i;
pad_data[i].max_linked_id_ptr = &max_linked_id; pad_data[i].max_linked_id_ptr = &max_linked_id;
if (i == 0)
pad_data[i].eos_count_ptr = &eos_seen; pad_data[i].eos_count_ptr = &eos_seen;
else
pad_data[i].eos_count_ptr = NULL;
pad_data[i].is_linked = (i == 0) ? TRUE : FALSE; pad_data[i].is_linked = (i == 0) ? TRUE : FALSE;
pad_data[i].n_linked = 1; pad_data[i].n_linked = 1;
pad_data[i].cond = &cond; pad_data[i].cond = &cond;
@ -698,8 +702,8 @@ GST_START_TEST (test_sparse_stream)
/* Wait while the buffers are processed */ /* Wait while the buffers are processed */
g_mutex_lock (&mutex); g_mutex_lock (&mutex);
/* We wait until EOS has been pushed on all pads */ /* We wait until EOS has been pushed on pad 1 */
while (eos_seen < 2) { while (eos_seen < 1) {
g_cond_wait (&cond, &mutex); g_cond_wait (&cond, &mutex);
} }
g_mutex_unlock (&mutex); g_mutex_unlock (&mutex);