transcriberbin: fix internal ghost pad name regression

As part of https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1593
source pad names on inner transcription bins were appended a suffix, but
other pieces of the code were not updated to account for that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1645>
This commit is contained in:
Mathieu Duponchelle 2024-07-01 11:45:41 +02:00
parent f303992e0c
commit 0ef886ea16

View file

@ -875,7 +875,10 @@ impl TranscriberBin {
channel.link_transcriber(&pad_state.transcriber)?; channel.link_transcriber(&pad_state.transcriber)?;
let srcpad = pad_state.transcription_bin.static_pad("src").unwrap(); let srcpad = pad_state
.transcription_bin
.static_pad(&format!("src_{}", channel.language))
.unwrap();
srcpad srcpad
.downcast_ref::<gst::GhostPad>() .downcast_ref::<gst::GhostPad>()
@ -1545,11 +1548,16 @@ impl ElementImpl for TranscriberBin {
let _ = pad_state.transcription_bin.set_state(gst::State::Null); let _ = pad_state.transcription_bin.set_state(gst::State::Null);
if let Some(ref mut state) = s.as_mut() { if let Some(ref mut state) = s.as_mut() {
if let Some(srcpad) = pad_state.transcription_bin.static_pad("src") { for channel in pad_state.transcription_channels.values() {
if let Some(srcpad) = pad_state
.transcription_bin
.static_pad(&format!("src_{}", channel.language))
{
if let Some(peer) = srcpad.peer() { if let Some(peer) = srcpad.peer() {
let _ = state.ccmux.remove_pad(&peer); let _ = state.ccmux.remove_pad(&peer);
} }
} }
}
let _ = state.transcription_bin.remove(&pad_state.transcription_bin); let _ = state.transcription_bin.remove(&pad_state.transcription_bin);
for srcpad in pad_state.audio_tee.iterate_src_pads() { for srcpad in pad_state.audio_tee.iterate_src_pads() {