decklinkvideosrc: Add the diff between the pipeline base time and when we start to play
Add the diff between the external time when we went to playing and the external time when the pipeline went to playing. Otherwise we will always start outputting from 0 instead of the current running time.
This commit is contained in:
parent
d4575e759b
commit
f83ac624e3
@ -381,11 +381,23 @@ gst_decklink_video_src_convert_to_external_clock (GstDecklinkVideoSrc * self,
|
||||
|
||||
if (rate_n != rate_d && self->internal_base_time != GST_CLOCK_TIME_NONE) {
|
||||
GstClockTime internal_timestamp = *timestamp;
|
||||
GstClockTimeDiff external_start_time_diff;
|
||||
|
||||
// Convert to the running time corresponding to both clock times
|
||||
internal -= self->internal_base_time;
|
||||
external -= self->external_base_time;
|
||||
|
||||
// Add the diff between the external time when we
|
||||
// went to playing and the external time when the
|
||||
// pipeline went to playing. Otherwise we will
|
||||
// always start outputting from 0 instead of the
|
||||
// current running time.
|
||||
external_start_time_diff =
|
||||
gst_element_get_base_time (GST_ELEMENT_CAST (self));
|
||||
external_start_time_diff =
|
||||
self->external_base_time - external_start_time_diff;
|
||||
external += external_start_time_diff;
|
||||
|
||||
// Get the difference in the internal time, note
|
||||
// that the capture time is internal time.
|
||||
// Then scale this difference and offset it to
|
||||
|
Loading…
x
Reference in New Issue
Block a user