diff options
author | Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com> | 2023-10-25 01:32:41 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-11-10 17:01:55 +0300 |
commit | 8deb2d26a83ee54edc198c0635c31145ddd4e366 (patch) | |
tree | 9ee80c19f1a6f3d632ce7aaa28b4223642cd3900 /utils | |
parent | 3a7bf71483e46e3096f674fda33ffc1d0368c3d9 (diff) |
livesync: Simplify num_duplicate counting
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1388>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/livesync/src/livesync/imp.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/utils/livesync/src/livesync/imp.rs b/utils/livesync/src/livesync/imp.rs index d198f0a6..5a2363c0 100644 --- a/utils/livesync/src/livesync/imp.rs +++ b/utils/livesync/src/livesync/imp.rs @@ -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); |