mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +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.
|
||||
drop(rec_state);
|
||||
|
||||
while !self.other_streams.lock().0.iter().all(|s| {
|
||||
let s = s.state.lock();
|
||||
s.eos
|
||||
|| (s.current_running_time.is_some()
|
||||
&& s.current_running_time >= current_running_time)
|
||||
}) {
|
||||
while !state.flushing
|
||||
&& !self.other_streams.lock().0.iter().all(|s| {
|
||||
let s = s.state.lock();
|
||||
s.eos
|
||||
|| (s.current_running_time.is_some()
|
||||
&& s.current_running_time >= current_running_time)
|
||||
})
|
||||
{
|
||||
gst_log!(CAT, obj: pad, "Waiting for other streams to stop");
|
||||
self.main_stream_cond.wait(&mut state);
|
||||
}
|
||||
|
@ -582,12 +584,14 @@ impl ToggleRecord {
|
|||
// go EOS instead.
|
||||
drop(rec_state);
|
||||
|
||||
while !self.other_streams.lock().0.iter().all(|s| {
|
||||
let s = s.state.lock();
|
||||
s.eos
|
||||
|| (s.current_running_time.is_some()
|
||||
&& s.current_running_time >= current_running_time)
|
||||
}) {
|
||||
while !state.flushing
|
||||
&& !self.other_streams.lock().0.iter().all(|s| {
|
||||
let s = s.state.lock();
|
||||
s.eos
|
||||
|| (s.current_running_time.is_some()
|
||||
&& s.current_running_time >= current_running_time)
|
||||
})
|
||||
{
|
||||
gst_log!(CAT, obj: pad, "Waiting for other streams to start");
|
||||
self.main_stream_cond.wait(&mut state);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue