mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-04-28 07:55:22 +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
|
.pre_queued_buffers
|
||||||
.push(TimedBufferOrEvent::Buffer(running_time, buffer));
|
.push(TimedBufferOrEvent::Buffer(running_time, buffer));
|
||||||
|
|
||||||
if let Some(front_running_time) = state.pre_queued_buffers.iter().find_map(|o| {
|
if let Some((idx, front_running_time)) = state
|
||||||
if let TimedBufferOrEvent::Buffer(running_time, _) = o {
|
.pre_queued_buffers
|
||||||
Some(*running_time)
|
.iter()
|
||||||
} else {
|
.enumerate()
|
||||||
None
|
.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)
|
if running_time.saturating_sub(front_running_time)
|
||||||
>= gst::Signed::Positive(state.configured_latency)
|
>= gst::Signed::Positive(state.configured_latency)
|
||||||
{
|
{
|
||||||
// XXX: Optionally discard, error or just output anyway
|
gst::warning!(
|
||||||
gst::error!(
|
|
||||||
CAT,
|
CAT,
|
||||||
obj: pad,
|
obj: pad,
|
||||||
"Received no UTC time in the first {}",
|
"Received no UTC time in the first {}",
|
||||||
state.configured_latency
|
state.configured_latency
|
||||||
);
|
);
|
||||||
return Err(gst::FlowError::Error);
|
state.pre_queued_buffers.remove(idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue