tttocea608: forward gaps from upstream

taking our own latency into account

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/314>
This commit is contained in:
Mathieu Duponchelle 2020-04-22 02:14:04 +02:00
parent fbb2022b25
commit 5c82e6fe6c

View file

@ -196,12 +196,7 @@ lazy_static! {
}
impl TtToCea608 {
fn push_list(
&self,
bufferlist: gst::BufferList,
last_frame_no: u64,
new_frame_no: u64,
) -> Result<gst::FlowSuccess, gst::FlowError> {
fn push_gap(&self, last_frame_no: u64, new_frame_no: u64) {
if last_frame_no != new_frame_no {
let state = self.state.lock().unwrap();
let (fps_n, fps_d) = (
@ -227,6 +222,15 @@ impl TtToCea608 {
let _ = self.srcpad.push_event(event);
}
}
fn push_list(
&self,
bufferlist: gst::BufferList,
last_frame_no: u64,
new_frame_no: u64,
) -> Result<gst::FlowSuccess, gst::FlowError> {
self.push_gap(last_frame_no, new_frame_no);
self.srcpad.push_list(bufferlist)
}
@ -566,6 +570,11 @@ impl TtToCea608 {
*/
let _ = self.do_erase_display(min_frame_no, erase_display_frame_no);
}
} else {
let last_frame_no = state.last_frame_no;
state.last_frame_no = frame_no;
drop(state);
self.push_gap(last_frame_no, frame_no);
}
return true;