From 1b286af5d667f40362411d106881c042ce18a834 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 5 Jul 2011 16:20:03 +0200 Subject: [PATCH] queue: fix unit test Set the right position member in the segment event. Add some debug to queue. --- plugins/elements/gstqueue.c | 2 ++ tests/check/elements/queue.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index feeaf54..3e16fe8 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -540,6 +540,7 @@ update_time_level (GstQueue * queue) gint64 sink_time, src_time; if (queue->sink_tainted) { + GST_LOG_OBJECT (queue, "update sink time"); queue->sinktime = gst_segment_to_running_time (&queue->sink_segment, GST_FORMAT_TIME, queue->sink_segment.position); @@ -548,6 +549,7 @@ update_time_level (GstQueue * queue) sink_time = queue->sinktime; if (queue->src_tainted) { + GST_LOG_OBJECT (queue, "update src time"); queue->srctime = gst_segment_to_running_time (&queue->src_segment, GST_FORMAT_TIME, queue->src_segment.position); diff --git a/tests/check/elements/queue.c b/tests/check/elements/queue.c index dbede1a..7ccfec7 100644 --- a/tests/check/elements/queue.c +++ b/tests/check/elements/queue.c @@ -553,6 +553,7 @@ GST_START_TEST (test_time_level_task_not_started) segment.start = 1 * GST_SECOND; segment.stop = 5 * GST_SECOND; segment.time = 0; + segment.position = 1 * GST_SECOND; event = gst_event_new_segment (&segment); gst_pad_push_event (mysrcpad, event); @@ -565,6 +566,7 @@ GST_START_TEST (test_time_level_task_not_started) gst_pad_push_event (mysrcpad, event); g_object_get (G_OBJECT (queue), "current-level-time", &time, NULL); + GST_DEBUG ("time now %" GST_TIME_FORMAT, GST_TIME_ARGS (time)); fail_if (time != 4 * GST_SECOND); GST_DEBUG ("stopping"); -- 2.7.4