Add quotes around BYTERANGE attribute

- EXT-X-MAP BYTERANGE attribute requires quotations around it.

Change-Id: Iee073b4c40bbf41b4dc319e8a447905c004cea3b
This commit is contained in:
Rintaro Kuroiwa 2017-07-13 17:13:30 -07:00
parent 013a83c9d4
commit a4c227f74a
2 changed files with 5 additions and 5 deletions

View File

@ -52,8 +52,8 @@ std::string CreateExtXMap(const MediaInfo& media_info) {
const uint64_t begin = media_info.init_range().begin(); const uint64_t begin = media_info.init_range().begin();
const uint64_t end = media_info.init_range().end(); const uint64_t end = media_info.init_range().end();
const uint64_t length = end - begin + 1; const uint64_t length = end - begin + 1;
base::StringAppendF(&ext_x_map, ",BYTERANGE=%" PRIu64 "@%" PRIu64, length, base::StringAppendF(&ext_x_map, ",BYTERANGE=\"%" PRIu64 "@%" PRIu64 "\"",
begin); length, begin);
} }
ext_x_map += "\n"; ext_x_map += "\n";
return ext_x_map; return ext_x_map;

View File

@ -150,7 +150,7 @@ TEST_F(MediaPlaylistSingleSegmentTest, InitRange) {
"test\n" "test\n"
"#EXT-X-TARGETDURATION:0\n" "#EXT-X-TARGETDURATION:0\n"
"#EXT-X-PLAYLIST-TYPE:VOD\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"; "#EXT-X-ENDLIST\n";
valid_video_media_info_.set_media_file_name("file.mp4"); valid_video_media_info_.set_media_file_name("file.mp4");
valid_video_media_info_.mutable_init_range()->set_begin(0); valid_video_media_info_.mutable_init_range()->set_begin(0);
@ -170,7 +170,7 @@ TEST_F(MediaPlaylistSingleSegmentTest, InitRangeWithOffset) {
"test\n" "test\n"
"#EXT-X-TARGETDURATION:0\n" "#EXT-X-TARGETDURATION:0\n"
"#EXT-X-PLAYLIST-TYPE:VOD\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"; "#EXT-X-ENDLIST\n";
valid_video_media_info_.set_media_file_name("file.mp4"); valid_video_media_info_.set_media_file_name("file.mp4");
valid_video_media_info_.mutable_init_range()->set_begin(16); valid_video_media_info_.mutable_init_range()->set_begin(16);
@ -192,7 +192,7 @@ TEST_F(MediaPlaylistSingleSegmentTest, AddSegmentByteRange) {
"test\n" "test\n"
"#EXT-X-TARGETDURATION:10\n" "#EXT-X-TARGETDURATION:10\n"
"#EXT-X-PLAYLIST-TYPE:VOD\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" "#EXTINF:10.000,\n"
"#EXT-X-BYTERANGE:1000000@1000\n" "#EXT-X-BYTERANGE:1000000@1000\n"
"file.mp4\n" "file.mp4\n"