From 45b39fcfc1bc820d8d41fb810f57c1d5765de98b Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Sat, 3 Apr 2010 22:49:11 +0300 Subject: [PATCH] audiotestsrc: swap timestamps in forward and reverse mode. In reverse mode we want use the next next timestamp (and not the other way around). Fixes the tests again. Also readd a log line that was dropped with previous commit. --- gst/audiotestsrc/gstaudiotestsrc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index 43fd3a5864..5b689713fb 100644 --- a/gst/audiotestsrc/gstaudiotestsrc.c +++ b/gst/audiotestsrc/gstaudiotestsrc.c @@ -1081,14 +1081,16 @@ gst_audio_test_src_create (GstBaseSrc * basesrc, guint64 offset, src->samplerate); GST_LOG_OBJECT (src, "samplerate %d", src->samplerate); + GST_LOG_OBJECT (src, "next_sample %" G_GINT64_FORMAT ", ts %" GST_TIME_FORMAT, + next_sample, GST_TIME_ARGS (next_time)); GST_BUFFER_OFFSET (buf) = src->next_sample; GST_BUFFER_OFFSET_END (buf) = next_sample; if (!src->reverse) { - GST_BUFFER_TIMESTAMP (buf) = src->timestamp_offset + next_time; + GST_BUFFER_TIMESTAMP (buf) = src->timestamp_offset + src->next_time; GST_BUFFER_DURATION (buf) = next_time - src->next_time; } else { - GST_BUFFER_TIMESTAMP (buf) = src->timestamp_offset + src->next_time; + GST_BUFFER_TIMESTAMP (buf) = src->timestamp_offset + next_time; GST_BUFFER_DURATION (buf) = src->next_time - next_time; }