1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-11-26 00:51:00 +00:00

Fix handling of BYTERANGE attribute

This commit is contained in:
Takeru Ohta 2018-02-20 17:22:48 +09:00
parent 2b5a79b648
commit 0b04431d49

View file

@ -264,7 +264,7 @@ impl fmt::Display for ExtXMap {
write!(f, "{}", Self::PREFIX)?; write!(f, "{}", Self::PREFIX)?;
write!(f, "URI={}", self.uri)?; write!(f, "URI={}", self.uri)?;
if let Some(ref x) = self.range { if let Some(ref x) = self.range {
write!(f, ",BYTERANGE={}", x)?; write!(f, ",BYTERANGE=\"{}\"", x)?;
} }
Ok(()) Ok(())
} }
@ -281,7 +281,10 @@ impl FromStr for ExtXMap {
let (key, value) = track!(attr)?; let (key, value) = track!(attr)?;
match key { match key {
"URI" => uri = Some(track!(value.parse())?), "URI" => uri = Some(track!(value.parse())?),
"BYTERANGE" => range = Some(track!(value.parse())?), "BYTERANGE" => {
let s: QuotedString = track!(value.parse())?;
range = Some(track!(s.parse())?);
}
_ => { _ => {
// [6.3.1. General Client Responsibilities] // [6.3.1. General Client Responsibilities]
// > ignore any attribute/value pair with an unrecognized AttributeName. // > ignore any attribute/value pair with an unrecognized AttributeName.