diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2023-03-23 01:39:32 +0300 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2023-03-23 01:39:32 +0300 |
commit | 9e3110988c1928867338e72bd8dcbeeff367eb85 (patch) | |
tree | 698615e2618fcd9cd9da1f1b29e0a6f09cdd8292 /video | |
parent | ac52ea4d8eb8c653fd2dd2d7f1b67bf1397af038 (diff) |
transcriberbin: fix initial transcription bin setup
When passthrough=false at construction and the transcription bin
is linked after receiving video caps (and not on state change),
there could be a race where transcription-bin was linked with
tee but state change of the transcription-bin was not finished.
If upstream pushed a buffer at that point, it got a flushing flow
return and stopped streaming.
This is the same issue and the same fix as 558656deb5037a85d6213f2f9a857f4902c9502f
for the initial passthrough=false case.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1142>
Diffstat (limited to 'video')
-rw-r--r-- | video/closedcaption/src/transcriberbin/imp.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 338eca6b..997c9451 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -261,10 +261,6 @@ impl TranscriberBin { state.transcriber.set_property("latency", latency_ms); if !settings.passthrough { - let audio_tee_pad = state.audio_tee.request_pad_simple("src_%u").unwrap(); - let transcription_sink_pad = state.transcription_bin.static_pad("sink").unwrap(); - audio_tee_pad.link(&transcription_sink_pad).unwrap(); - state .transcription_bin .link_pads(Some("src"), &state.cccombiner, Some("caption")) @@ -272,6 +268,10 @@ impl TranscriberBin { state.transcription_bin.set_locked_state(false); state.transcription_bin.sync_state_with_parent().unwrap(); + + let audio_tee_pad = state.audio_tee.request_pad_simple("src_%u").unwrap(); + let transcription_sink_pad = state.transcription_bin.static_pad("sink").unwrap(); + audio_tee_pad.link(&transcription_sink_pad).unwrap(); } drop(settings); |