diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index eece0f4b..1bb075d4 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -55,11 +55,6 @@ struct State { last_cc_pts: Option, } -// SAFETY: Required because `pango::Layout` is not `Send` but the whole `State` needs to be. -// We ensure that no additional references to the layout are ever created, which makes it safe -// to send it to other threads as long as only a single thread uses it concurrently. -unsafe impl Send for State {} - impl Default for State { fn default() -> Self { Self { diff --git a/video/closedcaption/src/cea608utils.rs b/video/closedcaption/src/cea608utils.rs index a930e548..9e714f4d 100644 --- a/video/closedcaption/src/cea608utils.rs +++ b/video/closedcaption/src/cea608utils.rs @@ -479,6 +479,11 @@ fn pango_foreground_color_from_608(color: Color) -> pango::AttrColor { pango::AttrColor::new_foreground(r, g, b) } +// SAFETY: Required because `pango::Layout` is not `Send` but the whole `Cea608Renderer` needs to be. +// We ensure that no additional references to the layout are ever created, which makes it safe +// to send it to other threads as long as only a single thread uses it concurrently. +unsafe impl Send for Cea608Renderer {} + pub struct Cea608Renderer { frame: Cea608Frame, state: Cea608State,