Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2021-08-25 16:54:29 +0300
committerVivia Nikolaidou <vivia@ahiru.eu>2021-08-27 11:59:33 +0300
commit6f14ebdfee9a8025553ea597b77eff7982230ae1 (patch)
tree48a9ebec5852683d8c6169a68c913b2d1e5bebb1 /utils/togglerecord
parentcfbc06274364b5362c520c9ac3db7bfef83d54e4 (diff)
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.
Diffstat (limited to 'utils/togglerecord')
-rw-r--r--utils/togglerecord/src/togglerecord/imp.rs10
1 files 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();
}