queue: fix unit test

Set the right position member in the segment event.
Add some debug to queue.
This commit is contained in:
Wim Taymans 2011-07-05 16:20:03 +02:00
parent 0a6ec83336
commit 1b286af5d6
2 changed files with 4 additions and 0 deletions

View file

@ -540,6 +540,7 @@ update_time_level (GstQueue * queue)
gint64 sink_time, src_time; gint64 sink_time, src_time;
if (queue->sink_tainted) { if (queue->sink_tainted) {
GST_LOG_OBJECT (queue, "update sink time");
queue->sinktime = queue->sinktime =
gst_segment_to_running_time (&queue->sink_segment, GST_FORMAT_TIME, gst_segment_to_running_time (&queue->sink_segment, GST_FORMAT_TIME,
queue->sink_segment.position); queue->sink_segment.position);
@ -548,6 +549,7 @@ update_time_level (GstQueue * queue)
sink_time = queue->sinktime; sink_time = queue->sinktime;
if (queue->src_tainted) { if (queue->src_tainted) {
GST_LOG_OBJECT (queue, "update src time");
queue->srctime = queue->srctime =
gst_segment_to_running_time (&queue->src_segment, GST_FORMAT_TIME, gst_segment_to_running_time (&queue->src_segment, GST_FORMAT_TIME,
queue->src_segment.position); queue->src_segment.position);

View file

@ -553,6 +553,7 @@ GST_START_TEST (test_time_level_task_not_started)
segment.start = 1 * GST_SECOND; segment.start = 1 * GST_SECOND;
segment.stop = 5 * GST_SECOND; segment.stop = 5 * GST_SECOND;
segment.time = 0; segment.time = 0;
segment.position = 1 * GST_SECOND;
event = gst_event_new_segment (&segment); event = gst_event_new_segment (&segment);
gst_pad_push_event (mysrcpad, event); 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); gst_pad_push_event (mysrcpad, event);
g_object_get (G_OBJECT (queue), "current-level-time", &time, NULL); 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); fail_if (time != 4 * GST_SECOND);
GST_DEBUG ("stopping"); GST_DEBUG ("stopping");