diff options
author | Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com> | 2023-10-25 01:32:41 +0300 |
---|---|---|
committer | Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com> | 2023-10-25 12:52:40 +0300 |
commit | 7c48a299c33b1b29c95b6f3d3c5a19cbdbed024d (patch) | |
tree | 82b676b128a4e67f44187c63bd4d6e7633e1a031 /utils | |
parent | 17a2448237d752d9b83358697eed16f02299c40e (diff) |
livesync: Simplify num_duplicate counting
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1369>
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); |