From add7fd269353955b7cd6b62517f52ef5a2315f9c Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Wed, 25 Aug 2021 16:54:29 +0300 Subject: togglerecord: Notify main_stream_cond on release_pad Otherwise, it would deadlock when releasing first the primary stream and then the secondary one, because it will wait in the "secondary stream" handling for the main stream to be fed, which will never happen. --- utils/togglerecord/src/togglerecord/imp.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index 858a4bc38..5ea63f222 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -2041,9 +2041,6 @@ impl ElementImpl for ToggleRecord { Some(stream) => stream.clone(), }; - stream.srcpad.set_active(false).unwrap(); - stream.sinkpad.set_active(false).unwrap(); - pads.remove(&stream.sinkpad).unwrap(); pads.remove(&stream.srcpad).unwrap(); @@ -2054,6 +2051,13 @@ impl ElementImpl for ToggleRecord { drop(pads); drop(other_streams_guard); + let main_state = self.main_stream.state.lock(); + self.main_stream_cond.notify_all(); + drop(main_state); + + stream.srcpad.set_active(false).unwrap(); + stream.sinkpad.set_active(false).unwrap(); + element.remove_pad(&stream.sinkpad).unwrap(); element.remove_pad(&stream.srcpad).unwrap(); } -- cgit v1.2.3