1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-06-01 19:43:39 +00:00

internalize decimal_floating_point #9

This commit is contained in:
Luro02 2019-09-15 18:54:25 +02:00
parent fd66f8b4ef
commit 42469275d3
3 changed files with 5 additions and 5 deletions

View file

@ -79,8 +79,8 @@ impl ExtXStreamInf {
} }
/// Returns the maximum frame rate for all the video in the variant stream. /// Returns the maximum frame rate for all the video in the variant stream.
pub const fn frame_rate(&self) -> Option<DecimalFloatingPoint> { pub fn frame_rate(&self) -> Option<f64> {
self.frame_rate self.frame_rate.map_or(None, |v| Some(v.as_f64()))
} }
/// Returns the HDCP level of the variant stream. /// Returns the HDCP level of the variant stream.

View file

@ -10,7 +10,7 @@ use crate::Error;
/// ///
/// [4.2. Attribute Lists]: https://tools.ietf.org/html/rfc8216#section-4.2 /// [4.2. Attribute Lists]: https://tools.ietf.org/html/rfc8216#section-4.2
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)] #[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
pub struct DecimalFloatingPoint(f64); pub(crate) struct DecimalFloatingPoint(f64);
impl DecimalFloatingPoint { impl DecimalFloatingPoint {
/// Makes a new `DecimalFloatingPoint` instance. /// Makes a new `DecimalFloatingPoint` instance.
@ -66,7 +66,7 @@ impl FromStr for DecimalFloatingPoint {
return Err(Error::invalid_input()); return Err(Error::invalid_input());
} }
let n = input.parse()?; let n = input.parse()?;
Ok(DecimalFloatingPoint(n)) DecimalFloatingPoint::new(n)
} }
} }

View file

@ -14,7 +14,7 @@ mod signed_decimal_floating_point;
pub use byte_range::*; pub use byte_range::*;
pub use closed_captions::*; pub use closed_captions::*;
pub use decimal_floating_point::*; pub(crate) use decimal_floating_point::*;
pub(crate) use decimal_resolution::*; pub(crate) use decimal_resolution::*;
pub use encryption_method::*; pub use encryption_method::*;
pub use hdcp_level::*; pub use hdcp_level::*;