mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-17 05:15:14 +00:00
task: do not resume when resume_receiver is cancelled
This could cause the state to go back to Started after stop() was called, resulting in a panic in a subsequent unprepare.
This commit is contained in:
parent
a9b43da6cd
commit
9ec6a02e13
1 changed files with 10 additions and 4 deletions
|
@ -360,10 +360,16 @@ impl Task {
|
|||
if let Some(resume_receiver) = resume_receiver.take() {
|
||||
gst_trace!(RUNTIME_CAT, "Task loop paused");
|
||||
|
||||
let _ = resume_receiver.await;
|
||||
|
||||
gst_trace!(RUNTIME_CAT, "Resuming task loop");
|
||||
inner_clone.lock().unwrap().state = TaskState::Started;
|
||||
match resume_receiver.await {
|
||||
Ok(_) => {
|
||||
gst_trace!(RUNTIME_CAT, "Resuming task loop");
|
||||
inner_clone.lock().unwrap().state = TaskState::Started;
|
||||
}
|
||||
Err(_) => {
|
||||
gst_trace!(RUNTIME_CAT, "Resume cancelled");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if func().await == glib::Continue(false) {
|
||||
|
|
Loading…
Reference in a new issue