mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-27 12:30:28 +00:00
onvifmetadataparse: Drop initial buffers until an UTC/running time mapping can be established
This commit is contained in:
parent
c6d8fec18f
commit
49602e1e01
1 changed files with 14 additions and 10 deletions
|
@ -271,24 +271,28 @@ impl OnvifMetadataParse {
|
|||
.pre_queued_buffers
|
||||
.push(TimedBufferOrEvent::Buffer(running_time, buffer));
|
||||
|
||||
if let Some(front_running_time) = state.pre_queued_buffers.iter().find_map(|o| {
|
||||
if let TimedBufferOrEvent::Buffer(running_time, _) = o {
|
||||
Some(*running_time)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}) {
|
||||
if let Some((idx, front_running_time)) = state
|
||||
.pre_queued_buffers
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find_map(|(idx, o)| {
|
||||
if let TimedBufferOrEvent::Buffer(running_time, _) = o {
|
||||
Some((idx, *running_time))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
{
|
||||
if running_time.saturating_sub(front_running_time)
|
||||
>= gst::Signed::Positive(state.configured_latency)
|
||||
{
|
||||
// XXX: Optionally discard, error or just output anyway
|
||||
gst::error!(
|
||||
gst::warning!(
|
||||
CAT,
|
||||
obj: pad,
|
||||
"Received no UTC time in the first {}",
|
||||
state.configured_latency
|
||||
);
|
||||
return Err(gst::FlowError::Error);
|
||||
state.pre_queued_buffers.remove(idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue