summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-03-04 16:05:28 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-03-04 16:07:10 +0100
commit912e58c64c66d20dfebad036499e3ff02f017bc1 (patch)
treebc76c98eda2a17c3492ce798afafd929438db1ea /sys
parent1f9d37c924b827e460f60f523e8233b2fb482440 (diff)
downloadgstreamer-plugins-bad-912e58c64c66d20dfebad036499e3ff02f017bc1.tar.gz
decklinkaudiosrc: Fix the timestamp and offset calculations even more
Diffstat (limited to 'sys')
-rw-r--r--sys/decklink/gstdecklinkaudiosrc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/decklink/gstdecklinkaudiosrc.cpp b/sys/decklink/gstdecklinkaudiosrc.cpp
index 5b070251c..08fc3b9e5 100644
--- a/sys/decklink/gstdecklinkaudiosrc.cpp
+++ b/sys/decklink/gstdecklinkaudiosrc.cpp
@@ -504,14 +504,11 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
// Jitter and discontinuity handling, based on audiobasesrc
start_time = timestamp;
- end_time = p->capture_time;
+ end_time = p->capture_time + duration;
// Convert to the sample numbers
- end_offset = gst_util_uint64_scale (end_time, self->info.rate, GST_SECOND);
- if (end_offset >= (guint64) sample_count)
- start_offset = end_offset - sample_count;
- else
- start_offset = 0;
+ start_offset = gst_util_uint64_scale (start_time, self->info.rate, GST_SECOND);
+ end_offset = start_offset + sample_count;
if (self->next_offset == (guint64) - 1) {
discont = TRUE;