mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-10 20:31:10 +00:00
mpegtslivesrc: Scale monotonic time on PCR disconts to allow for continuous clock times
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1767>
This commit is contained in:
parent
453b3014e6
commit
44f64fb3f6
1 changed files with 9 additions and 1 deletions
|
@ -198,7 +198,15 @@ impl MpegTSLiveSourceState {
|
||||||
monotonic_time,
|
monotonic_time,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
gst::error!(CAT, "DISCONT detected, Picking new reference times (pcr:{pcr:#?}, monotonic:{monotonic_time}");
|
let (internal, external, num, denom) = self.external_clock.calibration();
|
||||||
|
let scaled_monotonic = gst::Clock::adjust_with_calibration(
|
||||||
|
monotonic_time,
|
||||||
|
internal,
|
||||||
|
external,
|
||||||
|
num,
|
||||||
|
denom,
|
||||||
|
);
|
||||||
|
gst::warning!(CAT, "DISCONT detected, Picking new reference times (pcr:{pcr:#?}, monotonic:{monotonic_time}, scaled monotonic:{scaled_monotonic}");
|
||||||
new_pcr = MpegTsPcr::new(pcr);
|
new_pcr = MpegTsPcr::new(pcr);
|
||||||
self.base_pcr = Some(new_pcr);
|
self.base_pcr = Some(new_pcr);
|
||||||
self.base_monotonic = Some(monotonic_time);
|
self.base_monotonic = Some(monotonic_time);
|
||||||
|
|
Loading…
Reference in a new issue