mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-25 03:20:30 +00:00
fallbackswitch: Fix buffer clipping if no duration and 0/1 framerate
Instead of a division by 0, simply ignore the duration for clipping purposes.
This commit is contained in:
parent
e7053bc046
commit
7d88c014f8
1 changed files with 13 additions and 7 deletions
|
@ -673,12 +673,16 @@ impl AggregatorImpl for FallbackSwitch {
|
|||
)
|
||||
.unwrap()
|
||||
} else if let Some(ref video_info) = pad_state.video_info {
|
||||
gst::SECOND
|
||||
.mul_div_floor(
|
||||
*video_info.fps().denom() as u64,
|
||||
*video_info.fps().numer() as u64,
|
||||
)
|
||||
.unwrap()
|
||||
if *video_info.fps().numer() > 0 {
|
||||
gst::SECOND
|
||||
.mul_div_floor(
|
||||
*video_info.fps().denom() as u64,
|
||||
*video_info.fps().numer() as u64,
|
||||
)
|
||||
.unwrap()
|
||||
} else {
|
||||
gst::CLOCK_TIME_NONE
|
||||
}
|
||||
} else {
|
||||
unreachable!()
|
||||
};
|
||||
|
@ -704,7 +708,9 @@ impl AggregatorImpl for FallbackSwitch {
|
|||
let buffer = buffer.make_mut();
|
||||
buffer.set_pts(start);
|
||||
buffer.set_dts(start);
|
||||
buffer.set_duration(stop - start);
|
||||
if duration.is_some() {
|
||||
buffer.set_duration(stop - start);
|
||||
}
|
||||
}
|
||||
|
||||
buffer
|
||||
|
|
Loading…
Reference in a new issue