mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 06:50:59 +00:00
fallbacksrc: Fix timeout scheduling
Other thread can schedule the timeout (e.g., unblock signal or active pad change) while state lock is released Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1384>
This commit is contained in:
parent
9250c592a7
commit
8a04a38631
1 changed files with 15 additions and 12 deletions
|
@ -3206,21 +3206,24 @@ impl FallbackSrc {
|
||||||
} else {
|
} else {
|
||||||
let mut state_guard = imp.state.lock();
|
let mut state_guard = imp.state.lock();
|
||||||
let state = state_guard.as_mut().expect("no state");
|
let state = state_guard.as_mut().expect("no state");
|
||||||
if fallback_source {
|
let source = if fallback_source {
|
||||||
assert!(state
|
if let Some(source) = &state.fallback_source {
|
||||||
.fallback_source
|
source
|
||||||
.as_ref()
|
|
||||||
.map(|s| s.restart_timeout.is_none())
|
|
||||||
.unwrap_or(true));
|
|
||||||
} else {
|
} else {
|
||||||
assert!(state.source.restart_timeout.is_none());
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
&state.source
|
||||||
|
};
|
||||||
|
|
||||||
|
if source.restart_timeout.is_none() {
|
||||||
imp.schedule_source_restart_timeout(
|
imp.schedule_source_restart_timeout(
|
||||||
state,
|
state,
|
||||||
gst::ClockTime::ZERO,
|
gst::ClockTime::ZERO,
|
||||||
fallback_source,
|
fallback_source,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.expect("Failed to wait async");
|
.expect("Failed to wait async");
|
||||||
|
|
Loading…
Reference in a new issue