From 0b04431d4973b637e8d6bc60e2585c04a28a7957 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Tue, 20 Feb 2018 17:22:48 +0900 Subject: [PATCH] Fix handling of `BYTERANGE` attribute --- src/tags/media_segment.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tags/media_segment.rs b/src/tags/media_segment.rs index fe30e94..8a15f14 100644 --- a/src/tags/media_segment.rs +++ b/src/tags/media_segment.rs @@ -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.