summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2010-05-26 08:51:09 +0200
committerEdward Hervey <bilboed@bilboed.com>2010-05-26 08:51:09 +0200
commit514a34b255c66e32e3fcec5a496ff0300c3d0b2f (patch)
treee8b72b4e19f253ea84b73bbc0ee7c5db2d9703d6
parentfdfb70e2623fcc077f07f464cfb0319e6e0cdebc (diff)
audiorate: Fix buffer offset_end when within tolerance.
This fixes issues if we then have downstream elements that operate on offset/offset_end. And add the expected timestamp in the debug logs
-rw-r--r--gst/audiorate/gstaudiorate.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c
index f5f1d4973..fc6c84270 100644
--- a/gst/audiorate/gstaudiorate.c
+++ b/gst/audiorate/gstaudiorate.c
@@ -552,10 +552,11 @@ gst_audio_rate_chain (GstPad * pad, GstBuffer * buf)
GST_LOG_OBJECT (audiorate,
"in_time:%" GST_TIME_FORMAT ", in_duration:%" GST_TIME_FORMAT
", in_size:%u, in_offset:%" G_GUINT64_FORMAT ", in_offset_end:%"
- G_GUINT64_FORMAT ", ->next_offset:%" G_GUINT64_FORMAT,
- GST_TIME_ARGS (in_time),
+ G_GUINT64_FORMAT ", ->next_offset:%" G_GUINT64_FORMAT ", ->next_ts:%"
+ GST_TIME_FORMAT, GST_TIME_ARGS (in_time),
GST_TIME_ARGS (GST_FRAMES_TO_CLOCK_TIME (in_samples, audiorate->rate)),
- in_size, in_offset, in_offset_end, audiorate->next_offset);
+ in_size, in_offset, in_offset_end, audiorate->next_offset,
+ GST_TIME_ARGS (audiorate->next_ts));
diff = in_time - audiorate->next_ts;
if (diff <= (GstClockTimeDiff) audiorate->tolerance &&
@@ -565,6 +566,9 @@ gst_audio_rate_chain (GstPad * pad, GstBuffer * buf)
* it to next ts and offset and sending */
GST_LOG_OBJECT (audiorate, "within tolerance %" GST_TIME_FORMAT,
GST_TIME_ARGS (audiorate->tolerance));
+ /* The outgoing buffer's offset will be set to ->next_offset, we also
+ * need to adjust the offset_end value accordingly */
+ in_offset_end = audiorate->next_offset + in_samples;
goto send;
}