From bf14939b9bf2f3cae3e5cb554442a2dc983a1a0c Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 1 Apr 2022 10:01:46 +0200 Subject: [PATCH] uriplaylistbin: remove pad probe when shutting down The previous patch was unblocking the receiver in the pad probe but it could be blocked again as the item streaming status was not changed. --- utils/uriplaylistbin/src/uriplaylistbin/imp.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index e19fbec5..ad05123a 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -1430,7 +1430,12 @@ impl UriPlaylistBin { pad.name() ); - let _ = receiver.recv(); + if let Ok(false) = receiver.recv() { + // we are shutting down so remove the probe. + // Don't handle Err(_) here as if the item has multiple pads, the sender may be dropped in unblock_item() + // before all probes received the message, resulting in a receiving error. + return gst::PadProbeReturn::Remove; + } gst::log!( CAT,