From a4c227f74a728bf52c4378810df32fa2bcdc94ad Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Thu, 13 Jul 2017 17:13:30 -0700 Subject: [PATCH] Add quotes around BYTERANGE attribute - EXT-X-MAP BYTERANGE attribute requires quotations around it. Change-Id: Iee073b4c40bbf41b4dc319e8a447905c004cea3b --- packager/hls/base/media_playlist.cc | 4 ++-- packager/hls/base/media_playlist_unittest.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packager/hls/base/media_playlist.cc b/packager/hls/base/media_playlist.cc index 789a4da8c4..a131b91f81 100644 --- a/packager/hls/base/media_playlist.cc +++ b/packager/hls/base/media_playlist.cc @@ -52,8 +52,8 @@ std::string CreateExtXMap(const MediaInfo& media_info) { const uint64_t begin = media_info.init_range().begin(); const uint64_t end = media_info.init_range().end(); const uint64_t length = end - begin + 1; - base::StringAppendF(&ext_x_map, ",BYTERANGE=%" PRIu64 "@%" PRIu64, length, - begin); + base::StringAppendF(&ext_x_map, ",BYTERANGE=\"%" PRIu64 "@%" PRIu64 "\"", + length, begin); } ext_x_map += "\n"; return ext_x_map; diff --git a/packager/hls/base/media_playlist_unittest.cc b/packager/hls/base/media_playlist_unittest.cc index 0402edb016..8f6b731a50 100644 --- a/packager/hls/base/media_playlist_unittest.cc +++ b/packager/hls/base/media_playlist_unittest.cc @@ -150,7 +150,7 @@ TEST_F(MediaPlaylistSingleSegmentTest, InitRange) { "test\n" "#EXT-X-TARGETDURATION:0\n" "#EXT-X-PLAYLIST-TYPE:VOD\n" - "#EXT-X-MAP:URI=\"file.mp4\",BYTERANGE=501@0\n" + "#EXT-X-MAP:URI=\"file.mp4\",BYTERANGE=\"501@0\"\n" "#EXT-X-ENDLIST\n"; valid_video_media_info_.set_media_file_name("file.mp4"); valid_video_media_info_.mutable_init_range()->set_begin(0); @@ -170,7 +170,7 @@ TEST_F(MediaPlaylistSingleSegmentTest, InitRangeWithOffset) { "test\n" "#EXT-X-TARGETDURATION:0\n" "#EXT-X-PLAYLIST-TYPE:VOD\n" - "#EXT-X-MAP:URI=\"file.mp4\",BYTERANGE=485@16\n" + "#EXT-X-MAP:URI=\"file.mp4\",BYTERANGE=\"485@16\"\n" "#EXT-X-ENDLIST\n"; valid_video_media_info_.set_media_file_name("file.mp4"); valid_video_media_info_.mutable_init_range()->set_begin(16); @@ -192,7 +192,7 @@ TEST_F(MediaPlaylistSingleSegmentTest, AddSegmentByteRange) { "test\n" "#EXT-X-TARGETDURATION:10\n" "#EXT-X-PLAYLIST-TYPE:VOD\n" - "#EXT-X-MAP:URI=\"file.mp4\",BYTERANGE=501@0\n" + "#EXT-X-MAP:URI=\"file.mp4\",BYTERANGE=\"501@0\"\n" "#EXTINF:10.000,\n" "#EXT-X-BYTERANGE:1000000@1000\n" "file.mp4\n"