livesync: Support variable framerate in fallback buffer duration calc

Avoids a divide by zero error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1129>
This commit is contained in:
Talha Khan 2023-03-09 22:11:33 +08:00 committed by Guillaume Desmottes
parent 09a9877f40
commit 9a3f86f497

View file

@ -482,6 +482,7 @@ impl State {
.and_then(|c| c.structure(0))
.filter(|s| s.name().starts_with("video/"))
.and_then(|s| s.get::<gst::Fraction>("framerate").ok())
.filter(|framerate| framerate.denom() > 0 && framerate.numer() > 0)
.and_then(|framerate| {
gst::ClockTime::SECOND
.mul_div_round(framerate.denom() as u64, framerate.numer() as u64)