mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 06:50:59 +00:00
fmp4mux: Clip negative PTS to zero/last PTS instead of erroring out
This can happen at the beginning of a stream if upstream is rtpjitterbuffer and it has problems figuring out timestamps in the beginning due to resetting / skew.
This commit is contained in:
parent
627bf756b1
commit
938f4e4f1c
1 changed files with 10 additions and 8 deletions
|
@ -312,10 +312,11 @@ impl FMP4Mux {
|
|||
gst::error!(CAT, obj: stream.sinkpad, "Couldn't convert PTS to running time");
|
||||
gst::FlowError::Error
|
||||
})?
|
||||
.positive_or_else(|_| {
|
||||
gst::error!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
||||
gst::FlowError::Error
|
||||
})?;
|
||||
.positive()
|
||||
.unwrap_or_else(|| {
|
||||
gst::warning!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
||||
gst::ClockTime::ZERO
|
||||
});
|
||||
|
||||
let mut end_pts = segment
|
||||
.to_running_time_full(end_pts_position)
|
||||
|
@ -323,10 +324,11 @@ impl FMP4Mux {
|
|||
gst::error!(CAT, obj: stream.sinkpad, "Couldn't convert end PTS to running time");
|
||||
gst::FlowError::Error
|
||||
})?
|
||||
.positive_or_else(|_| {
|
||||
gst::error!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
||||
gst::FlowError::Error
|
||||
})?;
|
||||
.positive()
|
||||
.unwrap_or_else(|| {
|
||||
gst::warning!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
||||
gst::ClockTime::ZERO
|
||||
});
|
||||
|
||||
// Enforce monotonically increasing PTS for intra-only streams
|
||||
if !delta_frames.requires_dts() {
|
||||
|
|
Loading…
Reference in a new issue