mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-01 17:23:48 +00:00
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:
parent
21578ccb83
commit
907fca2aa2
2 changed files with 10 additions and 0 deletions
|
@ -796,7 +796,12 @@ impl TaskImpl for ProxySrcTask {
|
|||
let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap();
|
||||
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();
|
||||
|
||||
shared_ctx.last_res = Ok(gst::FlowSuccess::Ok);
|
||||
|
||||
gst::log!(SRC_CAT, obj = self.element, "Task started");
|
||||
|
|
|
@ -269,7 +269,12 @@ impl TaskImpl for QueueTask {
|
|||
let queue = self.element.imp();
|
||||
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();
|
||||
|
||||
*last_res = Ok(gst::FlowSuccess::Ok);
|
||||
|
||||
gst::log!(CAT, obj = self.element, "Task started");
|
||||
|
|
Loading…
Reference in a new issue