mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-24 16:46:25 +00:00
mpegtslivesrc: Consider the initial calibration of the clock too
Previously we assumed that the calibration is always at the origin but this is not necessarily true. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2105>
This commit is contained in:
parent
7b780e2aaf
commit
16bbe13f38
1 changed files with 15 additions and 1 deletions
|
@ -366,6 +366,14 @@ impl State {
|
|||
self.discont_pending = true;
|
||||
}
|
||||
} else {
|
||||
let (cinternal, cexternal, cnum, cdenom) = imp.external_clock.calibration();
|
||||
let base_external = gst::Clock::adjust_with_calibration(
|
||||
observation_internal,
|
||||
cinternal,
|
||||
cexternal,
|
||||
cnum,
|
||||
cdenom,
|
||||
);
|
||||
gst::debug!(
|
||||
CAT,
|
||||
imp = imp,
|
||||
|
@ -376,7 +384,13 @@ impl State {
|
|||
);
|
||||
new_pcr = MpegTsPcr::new(pcr);
|
||||
self.base_pcr = Some(new_pcr);
|
||||
self.base_external = Some(observation_internal);
|
||||
self.base_external = Some(base_external);
|
||||
imp.external_clock
|
||||
.set_calibration(observation_internal, base_external, 1, 1);
|
||||
// Hack to flush out observations, we set the window-size to the
|
||||
// same value
|
||||
imp.external_clock
|
||||
.set_window_size(imp.external_clock.window_size());
|
||||
self.discont_pending = true;
|
||||
}
|
||||
self.last_seen_pcr = Some(new_pcr);
|
||||
|
|
Loading…
Reference in a new issue