From 9a3f86f4977379edd2d4d528b99e26f84cd1f5d1 Mon Sep 17 00:00:00 2001 From: Talha Khan Date: Thu, 9 Mar 2023 22:11:33 +0800 Subject: [PATCH] livesync: Support variable framerate in fallback buffer duration calc Avoids a divide by zero error Part-of: --- utils/livesync/src/livesync/imp.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/livesync/src/livesync/imp.rs b/utils/livesync/src/livesync/imp.rs index 807e5c12..86de3b86 100644 --- a/utils/livesync/src/livesync/imp.rs +++ b/utils/livesync/src/livesync/imp.rs @@ -482,6 +482,7 @@ impl State { .and_then(|c| c.structure(0)) .filter(|s| s.name().starts_with("video/")) .and_then(|s| s.get::("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)