mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
livesync: Support variable framerate in fallback buffer duration calc
Avoids a divide by zero error Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1123>
This commit is contained in:
parent
9a50f1f318
commit
a12a8c566d
1 changed files with 1 additions and 0 deletions
|
@ -482,6 +482,7 @@ impl State {
|
|||
.and_then(|c| c.structure(0))
|
||||
.filter(|s| s.name().starts_with("video/"))
|
||||
.and_then(|s| s.get::<gst::Fraction>("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)
|
||||
|
|
Loading…
Reference in a new issue