summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2016-04-22 15:02:01 -0300
committerJan Schmidt <jan@centricular.com>2016-07-26 01:34:48 +1000
commit81da0d077a7a0539a50691f49f31c91ec75c9a37 (patch)
tree3bf726ea570ccefd16fa7cf0350301ccdd9ff707
parentfcfee09a4248be35ad93679c2b1c2b81a646a8fb (diff)
downloadgstreamer-plugins-bad-81da0d077a7a0539a50691f49f31c91ec75c9a37.tar.gz
tests: adaptivedemux: only check for data length after seek
When the test involves doing a seek, only check for data size after the seek. The final segment range after seek might be different/smaller than the threshold for doing the seek and doing the check before seeking would fail.
-rw-r--r--tests/check/elements/adaptive_demux_common.c20
-rw-r--r--tests/check/elements/adaptive_demux_common.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/check/elements/adaptive_demux_common.c b/tests/check/elements/adaptive_demux_common.c
index 44fd05035..e31044634 100644
--- a/tests/check/elements/adaptive_demux_common.c
+++ b/tests/check/elements/adaptive_demux_common.c
@@ -168,6 +168,25 @@ gst_adaptive_demux_test_check_received_data (GstAdaptiveDemuxTestEngine *
testOutputStreamData =
gst_adaptive_demux_test_find_test_data_by_stream (testData, stream, NULL);
fail_unless (testOutputStreamData != NULL);
+
+ GST_DEBUG
+ ("total_received_size=%" G_GUINT64_FORMAT
+ " segment_received_size = %" G_GUINT64_FORMAT
+ " buffer_size=%" G_GUINT64_FORMAT
+ " expected_size=%" G_GUINT64_FORMAT
+ " segment_start = %" G_GUINT64_FORMAT,
+ stream->total_received_size,
+ stream->segment_received_size,
+ (guint64) gst_buffer_get_size (buffer),
+ testOutputStreamData->expected_size, stream->segment_start);
+
+ /* Only verify after seeking */
+ if (testData->seek_event && testData->seeked)
+ fail_unless (stream->total_received_size +
+ stream->segment_received_size +
+ gst_buffer_get_size (buffer) <= testOutputStreamData->expected_size,
+ "Received unexpected data, please check what segments are being downloaded");
+
streamOffset = stream->segment_start + stream->segment_received_size;
if (testOutputStreamData->expected_data) {
gsize size = gst_buffer_get_size (buffer);
@@ -339,6 +358,7 @@ testSeekAdaptiveDemuxSendsData (GstAdaptiveDemuxTestEngine * engine,
g_cond_wait (&testData->test_task_state_cond,
&testData->test_task_state_lock);
}
+ testData->seeked = TRUE;
g_mutex_unlock (&testData->test_task_state_lock);
/* we can continue now, but this buffer will be rejected by AppSink
* because it is in flushing mode
diff --git a/tests/check/elements/adaptive_demux_common.h b/tests/check/elements/adaptive_demux_common.h
index fa8bde066..f830387cd 100644
--- a/tests/check/elements/adaptive_demux_common.h
+++ b/tests/check/elements/adaptive_demux_common.h
@@ -109,6 +109,7 @@ typedef struct _GstAdaptiveDemuxTestCase
*/
guint64 threshold_for_seek;
GstEvent *seek_event;
+ gboolean seeked;
gpointer signal_context;
} GstAdaptiveDemuxTestCase;