mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-06-05 23:18:55 +00:00
transcriberbin: Fix deadlock
Fix race between latency query handler and setup_transcription() method. Locking order of setup_transcription() is state lock -> setup_transcription() -> settings lock So taking state lock inside of setting lock in src_query() can cause deadlock.
This commit is contained in:
parent
1c2d4d4350
commit
ce24ca965e
1 changed files with 1 additions and 1 deletions
|
@ -396,7 +396,6 @@ impl TranscriberBin {
|
||||||
|
|
||||||
if ret {
|
if ret {
|
||||||
let (_, mut min, _) = upstream_query.result();
|
let (_, mut min, _) = upstream_query.result();
|
||||||
let settings = self.settings.lock().unwrap();
|
|
||||||
let received_framerate = {
|
let received_framerate = {
|
||||||
let state = self.state.lock().unwrap();
|
let state = self.state.lock().unwrap();
|
||||||
if let Some(state) = state.as_ref() {
|
if let Some(state) = state.as_ref() {
|
||||||
|
@ -406,6 +405,7 @@ impl TranscriberBin {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let settings = self.settings.lock().unwrap();
|
||||||
if settings.passthrough || !received_framerate {
|
if settings.passthrough || !received_framerate {
|
||||||
min += settings.latency + settings.accumulate_time;
|
min += settings.latency + settings.accumulate_time;
|
||||||
} else if settings.mode.is_rollup() {
|
} else if settings.mode.is_rollup() {
|
||||||
|
|
Loading…
Reference in a new issue