mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-22 18:16:28 +00:00
mpegtslivesrc: Set DISCONT flag on buffers at PCR discontinuities
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1767>
This commit is contained in:
parent
8fd2b7daa4
commit
453b3014e6
1 changed files with 6 additions and 15 deletions
|
@ -319,11 +319,8 @@ impl MpegTsLiveSource {
|
|||
(monotonic_time, get_pcr_from_buffer(self, &buffer))
|
||||
{
|
||||
if state.store_observation(raw_pcr, monotonic_time) {
|
||||
// FIXME: Handle PCR discontinuities more gracefully. This requires replacing the
|
||||
// clock and making sure that the application selects the new clock, and making
|
||||
// sure that tsdemux detects it correctly too.
|
||||
gst::element_imp_error!(self, gst::StreamError::Format, ["PCR discontinuity"]);
|
||||
return Err(gst::FlowError::Error);
|
||||
let buffer = buffer.make_mut();
|
||||
buffer.set_flags(gst::BufferFlags::DISCONT);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -353,7 +350,6 @@ impl MpegTsLiveSource {
|
|||
|
||||
// The last monotonic time
|
||||
let mut monotonic_time = None;
|
||||
let mut discont = false;
|
||||
|
||||
bufferlist.make_mut().foreach_mut(|mut buffer, _idx| {
|
||||
let this_buffer_timestamp = buffer.dts_or_pts();
|
||||
|
@ -369,7 +365,10 @@ impl MpegTsLiveSource {
|
|||
if let (Some(monotonic_time), Some(raw_pcr)) =
|
||||
(monotonic_time, get_pcr_from_buffer(self, &buffer))
|
||||
{
|
||||
discont = state.store_observation(raw_pcr, monotonic_time);
|
||||
if state.store_observation(raw_pcr, monotonic_time) {
|
||||
let buffer = buffer.make_mut();
|
||||
buffer.set_flags(gst::BufferFlags::DISCONT);
|
||||
}
|
||||
};
|
||||
|
||||
// Update buffer timestamp if present
|
||||
|
@ -387,14 +386,6 @@ impl MpegTsLiveSource {
|
|||
ControlFlow::Continue(Some(buffer))
|
||||
});
|
||||
|
||||
if discont {
|
||||
// FIXME: Handle PCR discontinuities more gracefully. This requires replacing the
|
||||
// clock and making sure that the application selects the new clock, and making
|
||||
// sure that tsdemux detects it correctly too.
|
||||
gst::element_imp_error!(self, gst::StreamError::Format, ["PCR discontinuity"]);
|
||||
return Err(gst::FlowError::Error);
|
||||
}
|
||||
|
||||
gst::ProxyPad::chain_list_default(pad, Some(&*self.obj()), bufferlist)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue