diff --git a/tests/old/testsuite/bytestream/gstbstest.c b/tests/old/testsuite/bytestream/gstbstest.c index 881cd3601b..4199a905f6 100644 --- a/tests/old/testsuite/bytestream/gstbstest.c +++ b/tests/old/testsuite/bytestream/gstbstest.c @@ -45,6 +45,7 @@ struct _GstBsTest GstByteStream *bs; gchar *accesspattern; + guint num_patterns; gchar **patterns; guint sizemin; guint sizemax; @@ -235,12 +236,11 @@ gst_bstest_loop (GstElement * element) bstest = GST_BSTEST (element); -/* THIS IS THE BUFFER BASED ONE */ do { guint size = 0; guint i = 0; - while (bstest->patterns[i]) { + while (i < bstest->num_patterns) { buf = NULL; if (bstest->patterns[i][0] == 'r') { @@ -271,7 +271,6 @@ gst_bstest_loop (GstElement * element) i++; } - } while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element)); } @@ -300,10 +299,14 @@ gst_bstest_set_property (GObject * object, guint prop_id, const GValue * value, if (g_value_get_string (value) == NULL) { gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL); bstest->accesspattern = NULL; - /* otherwise set the new filename */ + bstest->num_patterns = 0; } else { + guint i = 0; + bstest->accesspattern = g_strdup (g_value_get_string (value)); bstest->patterns = g_strsplit (bstest->accesspattern, ":", 0); + while (bstest->patterns[i++]); + bstest->num_patterns = i-1; } break; case ARG_COUNT: diff --git a/tests/old/testsuite/bytestream/testfile1 b/tests/old/testsuite/bytestream/testfile1 index 0f6247ae9b..68a32dd582 100644 --- a/tests/old/testsuite/bytestream/testfile1 +++ b/tests/old/testsuite/bytestream/testfile1 @@ -43,3 +43,51 @@ 2 2 pr:rr 1 2 3 p:rr 1 2 3 pr:rr 1 +1 2 pb:r 1 +1 2 pbr:r 1 +1 3 pb:r 1 +1 3 pbr:r 1 +2 2 pb:r 1 +2 2 pbr:r 1 +2 3 pb:r 1 +2 3 pbr:r 1 +1 2 pb:rr 1 +1 2 pbr:rr 1 +1 3 pb:rr 1 +1 3 pbr:rr 1 +2 2 pb:rr 1 +2 2 pbr:rr 1 +2 3 pb:rr 1 +2 3 pbr:rr 1 +1 2 p:fr:rr 0 +1 2 pr:fr:rr 0 +1 3 p:fr:rr 0 +1 3 pr:fr:rr 0 +2 2 p:fr:rr 0 +2 2 pr:fr:rr 0 +2 3 p:fr:rr 0 +2 3 pr:fr:rr 0 +1 2 fr:rr 0 +1 2 fr:rr 0 +1 3 fr:rr 0 +1 3 fr:rr 0 +2 2 fr:rr 0 +2 2 fr:rr 0 +2 3 fr:rr 0 +2 3 fr:rr 0 +1 2 fr:fr:rr 0 +1 2 fr:fr:rr 0 +1 3 fr:fr:rr 0 +1 3 fr:fr:rr 0 +2 2 fr:fr:rr 0 +2 2 fr:fr:rr 0 +2 3 fr:fr:rr 0 +2 3 fr:fr:rr 0 +1 2 pbr:pbr:rr 1 +1 2 pbr:pbr:rr 1 +1 3 pbr:pbr:rr 1 +1 3 pbr:pbr:rr 1 +2 2 pbr:pbr:rr 1 +2 2 pbr:pbr:rr 1 +2 3 pbr:pbr:rr 1 +2 3 pbr:pbr:rr 1 diff --git a/testsuite/bytestream/gstbstest.c b/testsuite/bytestream/gstbstest.c index 881cd3601b..4199a905f6 100644 --- a/testsuite/bytestream/gstbstest.c +++ b/testsuite/bytestream/gstbstest.c @@ -45,6 +45,7 @@ struct _GstBsTest GstByteStream *bs; gchar *accesspattern; + guint num_patterns; gchar **patterns; guint sizemin; guint sizemax; @@ -235,12 +236,11 @@ gst_bstest_loop (GstElement * element) bstest = GST_BSTEST (element); -/* THIS IS THE BUFFER BASED ONE */ do { guint size = 0; guint i = 0; - while (bstest->patterns[i]) { + while (i < bstest->num_patterns) { buf = NULL; if (bstest->patterns[i][0] == 'r') { @@ -271,7 +271,6 @@ gst_bstest_loop (GstElement * element) i++; } - } while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element)); } @@ -300,10 +299,14 @@ gst_bstest_set_property (GObject * object, guint prop_id, const GValue * value, if (g_value_get_string (value) == NULL) { gst_element_set_state (GST_ELEMENT (object), GST_STATE_NULL); bstest->accesspattern = NULL; - /* otherwise set the new filename */ + bstest->num_patterns = 0; } else { + guint i = 0; + bstest->accesspattern = g_strdup (g_value_get_string (value)); bstest->patterns = g_strsplit (bstest->accesspattern, ":", 0); + while (bstest->patterns[i++]); + bstest->num_patterns = i-1; } break; case ARG_COUNT: diff --git a/testsuite/bytestream/testfile1 b/testsuite/bytestream/testfile1 index 0f6247ae9b..68a32dd582 100644 --- a/testsuite/bytestream/testfile1 +++ b/testsuite/bytestream/testfile1 @@ -43,3 +43,51 @@ 2 2 pr:rr 1 2 3 p:rr 1 2 3 pr:rr 1 +1 2 pb:r 1 +1 2 pbr:r 1 +1 3 pb:r 1 +1 3 pbr:r 1 +2 2 pb:r 1 +2 2 pbr:r 1 +2 3 pb:r 1 +2 3 pbr:r 1 +1 2 pb:rr 1 +1 2 pbr:rr 1 +1 3 pb:rr 1 +1 3 pbr:rr 1 +2 2 pb:rr 1 +2 2 pbr:rr 1 +2 3 pb:rr 1 +2 3 pbr:rr 1 +1 2 p:fr:rr 0 +1 2 pr:fr:rr 0 +1 3 p:fr:rr 0 +1 3 pr:fr:rr 0 +2 2 p:fr:rr 0 +2 2 pr:fr:rr 0 +2 3 p:fr:rr 0 +2 3 pr:fr:rr 0 +1 2 fr:rr 0 +1 2 fr:rr 0 +1 3 fr:rr 0 +1 3 fr:rr 0 +2 2 fr:rr 0 +2 2 fr:rr 0 +2 3 fr:rr 0 +2 3 fr:rr 0 +1 2 fr:fr:rr 0 +1 2 fr:fr:rr 0 +1 3 fr:fr:rr 0 +1 3 fr:fr:rr 0 +2 2 fr:fr:rr 0 +2 2 fr:fr:rr 0 +2 3 fr:fr:rr 0 +2 3 fr:fr:rr 0 +1 2 pbr:pbr:rr 1 +1 2 pbr:pbr:rr 1 +1 3 pbr:pbr:rr 1 +1 3 pbr:pbr:rr 1 +2 2 pbr:pbr:rr 1 +2 2 pbr:pbr:rr 1 +2 3 pbr:pbr:rr 1 +2 3 pbr:pbr:rr 1