mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-18 05:45:14 +00:00
togglerecord: Check for flushing when the main stream waits for the other streams
Otherwise it would not wake up and return when shutting down the element.
This commit is contained in:
parent
514f6ea7ec
commit
cdca6c9372
1 changed files with 16 additions and 12 deletions
|
@ -497,12 +497,14 @@ impl ToggleRecord {
|
||||||
// instead.
|
// instead.
|
||||||
drop(rec_state);
|
drop(rec_state);
|
||||||
|
|
||||||
while !self.other_streams.lock().0.iter().all(|s| {
|
while !state.flushing
|
||||||
|
&& !self.other_streams.lock().0.iter().all(|s| {
|
||||||
let s = s.state.lock();
|
let s = s.state.lock();
|
||||||
s.eos
|
s.eos
|
||||||
|| (s.current_running_time.is_some()
|
|| (s.current_running_time.is_some()
|
||||||
&& s.current_running_time >= current_running_time)
|
&& s.current_running_time >= current_running_time)
|
||||||
}) {
|
})
|
||||||
|
{
|
||||||
gst_log!(CAT, obj: pad, "Waiting for other streams to stop");
|
gst_log!(CAT, obj: pad, "Waiting for other streams to stop");
|
||||||
self.main_stream_cond.wait(&mut state);
|
self.main_stream_cond.wait(&mut state);
|
||||||
}
|
}
|
||||||
|
@ -582,12 +584,14 @@ impl ToggleRecord {
|
||||||
// go EOS instead.
|
// go EOS instead.
|
||||||
drop(rec_state);
|
drop(rec_state);
|
||||||
|
|
||||||
while !self.other_streams.lock().0.iter().all(|s| {
|
while !state.flushing
|
||||||
|
&& !self.other_streams.lock().0.iter().all(|s| {
|
||||||
let s = s.state.lock();
|
let s = s.state.lock();
|
||||||
s.eos
|
s.eos
|
||||||
|| (s.current_running_time.is_some()
|
|| (s.current_running_time.is_some()
|
||||||
&& s.current_running_time >= current_running_time)
|
&& s.current_running_time >= current_running_time)
|
||||||
}) {
|
})
|
||||||
|
{
|
||||||
gst_log!(CAT, obj: pad, "Waiting for other streams to start");
|
gst_log!(CAT, obj: pad, "Waiting for other streams to start");
|
||||||
self.main_stream_cond.wait(&mut state);
|
self.main_stream_cond.wait(&mut state);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue