dav1ddec: Deal with the possibilty of 0/1 fps in latency math
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/698>
@@ -641,10 +641,15 @@ impl VideoDecoderImpl for Dav1dDec {
.into()
};
+ let fps_n = match info.fps().numer() {
+ 0 => 30, // Pretend we're at 30fps if we don't know latency,
+ n => n,
+ };
+
let latency = frame_latency
* (info.fps().denom() as u64)
* gst::ClockTime::SECOND
- / (info.fps().numer() as u64);
+ / (fps_n as u64);
gst::debug!(CAT, obj: element, "Reporting latency of {}", latency);
