mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-17 23:56:29 +00:00
cea708mux: make sure to empty the stored pending codes
Fixes some captions being truncated if multiple of the same service is received in the same input buffer. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1984>
This commit is contained in:
parent
db8e1da65d
commit
a2279bc253
1 changed files with 16 additions and 0 deletions
|
@ -324,6 +324,22 @@ impl AggregatorImpl for Cea708Mux {
|
|||
}
|
||||
}
|
||||
}
|
||||
for (service_no, pending_codes) in pad_state.pending_services.iter_mut() {
|
||||
let new_service = services
|
||||
.entry(*service_no)
|
||||
.or_insert_with_key(|&n| Service::new(n));
|
||||
|
||||
while let Some(code) = pending_codes.pop_front() {
|
||||
match new_service.push_code(&code) {
|
||||
Ok(_) => (),
|
||||
Err(cea708_types::WriterError::WouldOverflow(_)) => {
|
||||
pending_codes.push_front(code);
|
||||
break;
|
||||
}
|
||||
Err(cea708_types::WriterError::ReadOnly) => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue