1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-11-13 02:41:10 +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, "URI={}", self.uri)?;
if let Some(ref x) = self.range {
write!(f, ",BYTERANGE={}", x)?;
write!(f, ",BYTERANGE=\"{}\"", x)?;
}
Ok(())
}
@ -281,7 +281,10 @@ impl FromStr for ExtXMap {
let (key, value) = track!(attr)?;
match key {
"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]
// > ignore any attribute/value pair with an unrecognized AttributeName.