livesync: Move a notify closer to the interesting state change

Move the `notify_all` to where we pop the buffer. We're moving within a
single state lock so no change in behavior.

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:18:03 +02:00
parent 44f2195674
commit 1740a8e363

View file

@ -1074,6 +1074,7 @@ impl LiveSync {
None None
} else { } else {
state.buffer_queued = false; state.buffer_queued = false;
self.cond.notify_all();
Some((buffer, lateness)) Some((buffer, lateness))
} }
} }
@ -1138,7 +1139,6 @@ impl LiveSync {
segment = state.pending_segment.take(); segment = state.pending_segment.take();
duplicate = lateness != BufferLateness::OnTime; duplicate = lateness != BufferLateness::OnTime;
self.cond.notify_all();
} }
None => { None => {
// Work around borrow checker // Work around borrow checker