From 362a1a22ce4f5378f929aa4c1cc2e99d55e69d45 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 14 Jul 2025 23:28:42 +0200 Subject: [PATCH] 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: --- video/closedcaption/src/cea708mux/imp.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/closedcaption/src/cea708mux/imp.rs b/video/closedcaption/src/cea708mux/imp.rs index 7da7c738d..9591a4ea2 100644 --- a/video/closedcaption/src/cea708mux/imp.rs +++ b/video/closedcaption/src/cea708mux/imp.rs @@ -532,9 +532,10 @@ impl AggregatorImpl for Cea708Mux { return Some(buffer); }; let segment = aggregator_pad.segment(); + segment .downcast_ref::() - .map(|segment| segment.clip(pts, pts)) + .and_then(|segment| segment.clip(pts, pts)) .map(|_| buffer) } }