mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-06-05 23:18:55 +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
e268577994
commit
8e2a6500aa
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::error!(CAT, obj: stream.sinkpad, "Couldn't convert PTS to running time");
|
||||||
gst::FlowError::Error
|
gst::FlowError::Error
|
||||||
})?
|
})?
|
||||||
.positive_or_else(|_| {
|
.positive()
|
||||||
gst::error!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
.unwrap_or_else(|| {
|
||||||
gst::FlowError::Error
|
gst::warning!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
||||||
})?;
|
gst::ClockTime::ZERO
|
||||||
|
});
|
||||||
|
|
||||||
let mut end_pts = segment
|
let mut end_pts = segment
|
||||||
.to_running_time_full(end_pts_position)
|
.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::error!(CAT, obj: stream.sinkpad, "Couldn't convert end PTS to running time");
|
||||||
gst::FlowError::Error
|
gst::FlowError::Error
|
||||||
})?
|
})?
|
||||||
.positive_or_else(|_| {
|
.positive()
|
||||||
gst::error!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
.unwrap_or_else(|| {
|
||||||
gst::FlowError::Error
|
gst::warning!(CAT, obj: stream.sinkpad, "Negative PTSs are not supported");
|
||||||
})?;
|
gst::ClockTime::ZERO
|
||||||
|
});
|
||||||
|
|
||||||
// Enforce monotonically increasing PTS for intra-only streams
|
// Enforce monotonically increasing PTS for intra-only streams
|
||||||
if !delta_frames.requires_dts() {
|
if !delta_frames.requires_dts() {
|
||||||
|
|
Loading…
Reference in a new issue