livesync: Simplify num_duplicate counting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1369>
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-10-25 00:32:41 +02:00
parent 17a2448237
commit 7c48a299c3

View file

@ -1125,7 +1125,6 @@ impl LiveSync {
}
};
let duplicate;
let mut caps = None;
let mut segment = None;
@ -1139,7 +1138,9 @@ impl LiveSync {
caps = state.pending_caps.take();
segment = state.pending_segment.take();
duplicate = lateness != BufferLateness::OnTime;
if lateness != BufferLateness::OnTime {
state.num_duplicate += 1;
}
}
None => {
// Work around borrow checker
@ -1178,7 +1179,7 @@ impl LiveSync {
state.out_buffer.as_ref().unwrap(),
state.out_segment.as_ref().unwrap(),
);
duplicate = true;
state.num_duplicate += 1;
}
}
@ -1223,9 +1224,6 @@ impl LiveSync {
}
state.num_out += 1;
if duplicate {
state.num_duplicate += 1;
}
drop(state);