mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 06:50:59 +00:00
uriplaylistbin: add Status::ShuttingDown
Fix a race where we were trying to process new decodedin pads while the element was being shutdown, resulting in a dead lock.
This commit is contained in:
parent
0ed72a360d
commit
69ceaa3a5e
1 changed files with 5 additions and 1 deletions
|
@ -105,6 +105,8 @@ enum Status {
|
|||
Running,
|
||||
/// the element stopped because of an error
|
||||
Error,
|
||||
/// the element is being shut down
|
||||
ShuttingDown,
|
||||
}
|
||||
|
||||
impl Status {
|
||||
|
@ -112,7 +114,7 @@ impl Status {
|
|||
fn done(&self) -> bool {
|
||||
match self {
|
||||
Status::Running => false,
|
||||
Status::Error => true,
|
||||
Status::Error | Status::ShuttingDown => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -950,6 +952,8 @@ impl ElementImpl for UriPlaylistBin {
|
|||
let mut state_guard = self.state.lock().unwrap();
|
||||
let state = state_guard.as_mut().unwrap();
|
||||
|
||||
state.status = Status::ShuttingDown;
|
||||
|
||||
// The probe callback owns a ref on the item and so on the sender as well.
|
||||
// As a result we have to explicitly unblock all receivers as dropping the sender
|
||||
// is not enough.
|
||||
|
|
Loading…
Reference in a new issue