mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-09-24 13:00:12 +00:00
utils/fallbacksrc: Block all currently unblocked pads when receiving the stream collection
It might be a second stream collection that we receive at a later time, and the previous pads would already be unblocked at that point. So block all currently unblocked pads again and then adjust the offset according to the new situation. This fixes playback of various RTMP streams where usually we first get a stream collection with only one of the two streams, and shortly afterwards with both streams.
This commit is contained in:
parent
d50abd74a1
commit
c91e480f09
1 changed files with 13 additions and 0 deletions
|
@ -1537,6 +1537,19 @@ impl FallbackSrc {
|
|||
|
||||
state.streams = Some(streams);
|
||||
|
||||
// This might not be the first stream collection and we might have some unblocked pads from
|
||||
// before already, which would need to be blocked again now for keeping things in sync
|
||||
for stream in [&mut state.video_stream, &mut state.audio_stream]
|
||||
.iter_mut()
|
||||
.filter_map(|v| v.as_mut())
|
||||
{
|
||||
if let Some(ref srcpad) = stream.source_srcpad {
|
||||
if stream.source_srcpad_block.is_none() {
|
||||
stream.source_srcpad_block = Some(self.add_pad_probe(element, srcpad));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.unblock_pads(element, state);
|
||||
|
||||
drop(state_guard);
|
||||
|
|
Loading…
Reference in a new issue