mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-28 22:41:02 +00:00
cea708mux: Stop with EOS if all pads are EOS instead of continuing forever
Also don't drop buffers if multiple tries are needed for aggregating because some pads are not ready yet. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1774>
This commit is contained in:
parent
29b54ed2fc
commit
d69d0f8738
1 changed files with 10 additions and 1 deletions
|
@ -127,6 +127,7 @@ impl AggregatorImpl for Cea708Mux {
|
|||
.nseconds();
|
||||
let end_running_time = start_running_time + duration;
|
||||
let mut need_data = false;
|
||||
let mut all_eos = true;
|
||||
gst::debug!(
|
||||
CAT,
|
||||
imp = self,
|
||||
|
@ -144,15 +145,20 @@ impl AggregatorImpl for Cea708Mux {
|
|||
.expect("Not a Cea708MuxSinkPad?!")
|
||||
}) {
|
||||
let mut pad_state = pad.imp().pad_state.lock().unwrap();
|
||||
pad_state.pending_buffer = None;
|
||||
// any data we currently have stored
|
||||
let have_pending = pad_state
|
||||
.pending_services
|
||||
.values()
|
||||
.any(|codes| !codes.is_empty());
|
||||
|
||||
if pad.is_eos() {
|
||||
if pad_state.pending_buffer.is_some() {
|
||||
all_eos = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
all_eos = false;
|
||||
|
||||
let buffer = if let Some(buffer) = pad.peek_buffer() {
|
||||
buffer
|
||||
} else {
|
||||
|
@ -229,6 +235,9 @@ impl AggregatorImpl for Cea708Mux {
|
|||
if need_data && !timeout {
|
||||
return Err(gst_base::AGGREGATOR_FLOW_NEED_DATA);
|
||||
}
|
||||
if all_eos {
|
||||
return Err(gst::FlowError::Eos);
|
||||
}
|
||||
|
||||
self.obj()
|
||||
.selected_samples(start_running_time, None, duration, None);
|
||||
|
|
Loading…
Reference in a new issue