mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
decklinkaudiosrc: Fix the timestamp and offset calculations even more
This commit is contained in:
parent
1f9d37c924
commit
912e58c64c
1 changed files with 3 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue