mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-02 01:33:47 +00:00
cea708mux: fix clipping function
The intention of the original implementation was to clip buffers outside the segments, but the second map was getting Some(None) in that case. Fix by using `and_then` for a flat map Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2372>
This commit is contained in:
parent
3a6a78d07f
commit
362a1a22ce
1 changed files with 2 additions and 1 deletions
|
@ -532,9 +532,10 @@ impl AggregatorImpl for Cea708Mux {
|
||||||
return Some(buffer);
|
return Some(buffer);
|
||||||
};
|
};
|
||||||
let segment = aggregator_pad.segment();
|
let segment = aggregator_pad.segment();
|
||||||
|
|
||||||
segment
|
segment
|
||||||
.downcast_ref::<gst::ClockTime>()
|
.downcast_ref::<gst::ClockTime>()
|
||||||
.map(|segment| segment.clip(pts, pts))
|
.and_then(|segment| segment.clip(pts, pts))
|
||||||
.map(|_| buffer)
|
.map(|_| buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue