diff options
author | Guillaume Desmottes <guillaume.desmottes@onestream.live> | 2022-04-08 12:23:31 +0300 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@onestream.live> | 2022-04-08 17:53:12 +0300 |
commit | c86d5c78f4756ac712e0d8efded117b80425131b (patch) | |
tree | b81ebb9ccb69dceb7acbf47701dd13fa95016db7 | |
parent | e3e4a109f9cc5c723aa1f7646f4bfdb4392f61d4 (diff) |
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.
-rw-r--r-- | utils/uriplaylistbin/src/uriplaylistbin/imp.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index 2513554cb..c8c55ce36 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -106,6 +106,8 @@ enum Status { Running, /// the element stopped because of an error Error, + /// the element is being shut down + ShuttingDown, } impl Status { @@ -113,7 +115,7 @@ impl Status { fn done(&self) -> bool { match self { Status::Running => false, - Status::Error => true, + Status::Error | Status::ShuttingDown => true, } } } @@ -951,6 +953,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. |