mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-02 17:53:48 +00:00
speechmatics: fix state cycling
The static source pad is added to the dynamic srcpads collection for convenience, so when the state transitions back to NULL and state is reset to its default, we need to make sure to re-add the static source pad to the collection. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2072>
This commit is contained in:
parent
6b9e3fd772
commit
5d83d27798
1 changed files with 15 additions and 0 deletions
|
@ -1534,8 +1534,19 @@ impl Transcriber {
|
|||
});
|
||||
}
|
||||
|
||||
let srcpads = state.srcpads.clone();
|
||||
|
||||
*state = State::default();
|
||||
|
||||
for srcpad in &srcpads {
|
||||
let mut sstate = srcpad.imp().state.lock().unwrap();
|
||||
let unsynced_pad = sstate.unsynced_pad.take();
|
||||
*sstate = TranscriberSrcPadState::default();
|
||||
sstate.unsynced_pad = unsynced_pad;
|
||||
}
|
||||
|
||||
state.srcpads = srcpads;
|
||||
|
||||
gst::info!(
|
||||
CAT,
|
||||
imp = self,
|
||||
|
@ -1551,6 +1562,10 @@ impl Transcriber {
|
|||
|
||||
let mut state = self.state.lock().unwrap();
|
||||
|
||||
if !state.connected {
|
||||
return None;
|
||||
}
|
||||
|
||||
if state.start_time.is_none() {
|
||||
state.start_time = Some(now);
|
||||
for pad in state.srcpads.iter() {
|
||||
|
|
Loading…
Reference in a new issue