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:
Mathieu Duponchelle 2025-07-14 23:28:42 +02:00 committed by Sebastian Dröge
parent 3a6a78d07f
commit 362a1a22ce

View file

@ -532,9 +532,10 @@ impl AggregatorImpl for Cea708Mux {
return Some(buffer);
};
let segment = aggregator_pad.segment();
segment
.downcast_ref::<gst::ClockTime>()
.map(|segment| segment.clip(pts, pts))
.and_then(|segment| segment.clip(pts, pts))
.map(|_| buffer)
}
}