From 80b9d7081a8de510f60d2daaae9bdb714bbe4da0 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 2 Dec 2024 10:36:23 +0100 Subject: [PATCH] togglerecord: release rec_state before pushing buffer Part-of: --- utils/togglerecord/src/togglerecord/imp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index d718ea57..a43f45cb 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -1351,8 +1351,6 @@ impl ToggleRecord { self.handle_main_stream(pad, &stream, buffer, upstream_live) }?; - let rec_state = self.state.lock(); - let mut buffer = match handle_result { HandleResult::Drop => { return Ok(gst::FlowSuccess::Ok); @@ -1377,6 +1375,7 @@ impl ToggleRecord { }; let out_running_time = { + let rec_state = self.state.lock(); let main_state = if stream != self.main_stream { Some(self.main_stream.state.lock()) } else { @@ -1427,6 +1426,7 @@ impl ToggleRecord { let out_running_time = state.out_segment.to_running_time(buffer.pts()); // Unlock before pushing + drop(rec_state); drop(state); drop(main_state);