decklinkaudiosrc: Fix the timestamp and offset calculations even more

This commit is contained in:
Sebastian Dröge 2015-03-04 16:05:28 +01:00
parent 1f9d37c924
commit 912e58c64c

View file

@ -504,14 +504,11 @@ gst_decklink_audio_src_create (GstPushSrc * bsrc, GstBuffer ** buffer)
// Jitter and discontinuity handling, based on audiobasesrc // Jitter and discontinuity handling, based on audiobasesrc
start_time = timestamp; start_time = timestamp;
end_time = p->capture_time; end_time = p->capture_time + duration;
// Convert to the sample numbers // Convert to the sample numbers
end_offset = gst_util_uint64_scale (end_time, self->info.rate, GST_SECOND); start_offset = gst_util_uint64_scale (start_time, self->info.rate, GST_SECOND);
if (end_offset >= (guint64) sample_count) end_offset = start_offset + sample_count;
start_offset = end_offset - sample_count;
else
start_offset = 0;
if (self->next_offset == (guint64) - 1) { if (self->next_offset == (guint64) - 1) {
discont = TRUE; discont = TRUE;