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>
This commit is contained in:
Arun Raghavan 2022-05-11 09:58:28 -04:00
parent 7eb67de34c
commit 2c3514a5a1

View file

@ -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);