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/1387>
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-10-25 00:18:03 +02:00 committed by Sebastian Dröge
parent ad97b21011
commit 395ef40fc9

View file

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