threadshare: fix regression in ts-proxysrc

This [MR] introduced a race condition when the `ts-proxysink` started pushing
items before `ts-prosysrc` had started.

This commit reverts the changes to `ProxySrcTask::start`: wake up the pending
queue when starting the task. Also applies this to `ts-queue` even though the
race condition is less likely to happen.

[MR]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2400

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2405>
This commit is contained in:
François Laignel 2025-07-30 16:24:48 +02:00
parent 21578ccb83
commit 907fca2aa2
2 changed files with 10 additions and 0 deletions

View file

@ -796,7 +796,12 @@ impl TaskImpl for ProxySrcTask {
let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap(); let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap();
let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared(); let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared();
if let Some(pending_queue) = shared_ctx.pending_queue.as_mut() {
pending_queue.notify_more_queue_space();
}
self.dataqueue.start(); self.dataqueue.start();
shared_ctx.last_res = Ok(gst::FlowSuccess::Ok); shared_ctx.last_res = Ok(gst::FlowSuccess::Ok);
gst::log!(SRC_CAT, obj = self.element, "Task started"); gst::log!(SRC_CAT, obj = self.element, "Task started");

View file

@ -269,7 +269,12 @@ impl TaskImpl for QueueTask {
let queue = self.element.imp(); let queue = self.element.imp();
let mut last_res = queue.last_res.lock().unwrap(); let mut last_res = queue.last_res.lock().unwrap();
if let Some(pending_queue) = queue.pending_queue.lock().unwrap().as_mut() {
pending_queue.notify_more_queue_space();
}
self.dataqueue.start(); self.dataqueue.start();
*last_res = Ok(gst::FlowSuccess::Ok); *last_res = Ok(gst::FlowSuccess::Ok);
gst::log!(CAT, obj = self.element, "Task started"); gst::log!(CAT, obj = self.element, "Task started");