mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-04 16:28:48 +00:00
utils/fallbackswitch: Use the correct segment when deciding to drop fallback buffers
Thanks to Jan Schmidt for noticing.
This commit is contained in:
parent
bf82e750f4
commit
331374fabe
1 changed files with 26 additions and 22 deletions
|
@ -219,8 +219,11 @@ impl FallbackSwitch {
|
||||||
|
|
||||||
// Drop all older buffers from the fallback sinkpad
|
// Drop all older buffers from the fallback sinkpad
|
||||||
if let Some(fallback_sinkpad) = fallback_sinkpad {
|
if let Some(fallback_sinkpad) = fallback_sinkpad {
|
||||||
let fallback_segment = self
|
let segment = fallback_sinkpad.get_segment();
|
||||||
.sinkpad
|
|
||||||
|
// Might have no segment at all yet
|
||||||
|
if segment.get_format() != gst::Format::Undefined {
|
||||||
|
let fallback_segment = fallback_sinkpad
|
||||||
.get_segment()
|
.get_segment()
|
||||||
.downcast::<gst::ClockTime>()
|
.downcast::<gst::ClockTime>()
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
|
@ -245,6 +248,7 @@ impl FallbackSwitch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let pad_states = self.pad_states.read().unwrap();
|
let pad_states = self.pad_states.read().unwrap();
|
||||||
let active_caps = pad_states.sinkpad.caps.as_ref().unwrap().clone();
|
let active_caps = pad_states.sinkpad.caps.as_ref().unwrap().clone();
|
||||||
|
|
Loading…
Reference in a new issue