From 627a756f0439744adfa89016ffc27abe43df4891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 17 Jun 2024 13:55:52 +0300 Subject: [PATCH] rtp: av1pay: Derive Default trait for the state instead of manual implementation Part-of: --- net/rtp/src/av1/pay/imp.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/net/rtp/src/av1/pay/imp.rs b/net/rtp/src/av1/pay/imp.rs index 804437ea..417b68e8 100644 --- a/net/rtp/src/av1/pay/imp.rs +++ b/net/rtp/src/av1/pay/imp.rs @@ -67,7 +67,7 @@ struct ObuData { pts: Option, } -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] struct State { /// Holds header information and raw bytes for all received OBUs, /// as well as DTS and PTS @@ -91,18 +91,6 @@ pub struct RTPAv1Pay { state: Mutex, } -impl Default for State { - fn default() -> Self { - Self { - obus: VecDeque::new(), - open_obu_fragment: false, - last_dts: None, - last_pts: None, - framed: false, - } - } -} - impl RTPAv1Pay { fn reset(&self, state: &mut State, full: bool) { gst::debug!(CAT, imp: self, "resetting state");