Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun@asymptotic.io>2022-05-11 16:58:28 +0300
committerArun Raghavan <arun@asymptotic.io>2022-05-11 17:02:10 +0300
commit2c3514a5a104bf7c7385516afbfe810146db4391 (patch)
tree97cd0d37062b09bef0c725a485c950cba296f177 /video/dav1d
parent7eb67de34c456b88c46591be9b931da3162cc94e (diff)
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>
Diffstat (limited to 'video/dav1d')
-rw-r--r--video/dav1d/src/dav1ddec/imp.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs
index c26f201ff..8b792a187 100644
--- a/video/dav1d/src/dav1ddec/imp.rs
+++ b/video/dav1d/src/dav1ddec/imp.rs
@@ -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);