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
committerSebastian Dröge <sebastian@centricular.com>2021-08-30 12:45:26 +0300
commitadd7fd269353955b7cd6b62517f52ef5a2315f9c (patch)
tree6482710af388274368e27461517b6f895af5ccd0
parentb62b5f96434bec80b51f554ca91c92300cf973ab (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.
-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();
}