mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-22 08:58:15 +00:00
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:
parent
7eb67de34c
commit
2c3514a5a1
1 changed files with 6 additions and 1 deletions
|
@ -641,10 +641,15 @@ impl VideoDecoderImpl for Dav1dDec {
|
||||||
.into()
|
.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
|
let latency = frame_latency
|
||||||
* (info.fps().denom() as u64)
|
* (info.fps().denom() as u64)
|
||||||
* gst::ClockTime::SECOND
|
* gst::ClockTime::SECOND
|
||||||
/ (info.fps().numer() as u64);
|
/ (fps_n as u64);
|
||||||
|
|
||||||
gst::debug!(CAT, obj: element, "Reporting latency of {}", latency);
|
gst::debug!(CAT, obj: element, "Reporting latency of {}", latency);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue