diff --git a/src/tags/master_playlist/stream_inf.rs b/src/tags/master_playlist/stream_inf.rs index 78dd7ee..808d4fc 100644 --- a/src/tags/master_playlist/stream_inf.rs +++ b/src/tags/master_playlist/stream_inf.rs @@ -79,8 +79,8 @@ impl ExtXStreamInf { } /// Returns the maximum frame rate for all the video in the variant stream. - pub const fn frame_rate(&self) -> Option { - self.frame_rate + pub fn frame_rate(&self) -> Option { + self.frame_rate.map_or(None, |v| Some(v.as_f64())) } /// Returns the HDCP level of the variant stream. diff --git a/src/types/decimal_floating_point.rs b/src/types/decimal_floating_point.rs index b044cc4..a829129 100644 --- a/src/types/decimal_floating_point.rs +++ b/src/types/decimal_floating_point.rs @@ -10,7 +10,7 @@ use crate::Error; /// /// [4.2. Attribute Lists]: https://tools.ietf.org/html/rfc8216#section-4.2 #[derive(Debug, Clone, Copy, PartialEq, PartialOrd)] -pub struct DecimalFloatingPoint(f64); +pub(crate) struct DecimalFloatingPoint(f64); impl DecimalFloatingPoint { /// Makes a new `DecimalFloatingPoint` instance. @@ -66,7 +66,7 @@ impl FromStr for DecimalFloatingPoint { return Err(Error::invalid_input()); } let n = input.parse()?; - Ok(DecimalFloatingPoint(n)) + DecimalFloatingPoint::new(n) } } diff --git a/src/types/mod.rs b/src/types/mod.rs index 83390b7..10641d3 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -14,7 +14,7 @@ mod signed_decimal_floating_point; pub use byte_range::*; pub use closed_captions::*; -pub use decimal_floating_point::*; +pub(crate) use decimal_floating_point::*; pub(crate) use decimal_resolution::*; pub use encryption_method::*; pub use hdcp_level::*;