Set MediaPlaylist version to 5
- Required for KEYFORMAT and KEYFORAMTVERSIONS attributes. Change-Id: I834cde6e475e4f1192db0c93c4b88e2ab838532e
This commit is contained in:
parent
abb1abf5c5
commit
dad07c95d7
|
@ -273,9 +273,9 @@ bool MediaPlaylist::WriteToFile(media::File* file) {
|
||||||
SetTargetDuration(ceil(GetLongestSegmentDuration()));
|
SetTargetDuration(ceil(GetLongestSegmentDuration()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// EXTINF with floating point duration requires version 4.
|
// KEYFORMAT and KEYFORMATVERSIONS on EXT-X-KEY requires 5 or above.
|
||||||
std::string header = base::StringPrintf("#EXTM3U\n"
|
std::string header = base::StringPrintf("#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\n"
|
||||||
"#EXT-X-TARGETDURATION:%d\n",
|
"#EXT-X-TARGETDURATION:%d\n",
|
||||||
target_duration_);
|
target_duration_);
|
||||||
if (type_ == MediaPlaylistType::kVod) {
|
if (type_ == MediaPlaylistType::kVod) {
|
||||||
|
|
|
@ -116,7 +116,7 @@ TEST_F(MediaPlaylistTest, WriteToFile) {
|
||||||
ASSERT_TRUE(media_playlist_.SetMediaInfo(valid_video_media_info_));
|
ASSERT_TRUE(media_playlist_.SetMediaInfo(valid_video_media_info_));
|
||||||
const std::string kExpectedOutput =
|
const std::string kExpectedOutput =
|
||||||
"#EXTM3U\n"
|
"#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\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-ENDLIST\n";
|
"#EXT-X-ENDLIST\n";
|
||||||
|
@ -171,7 +171,7 @@ TEST_F(MediaPlaylistTest, SetTargetDuration) {
|
||||||
EXPECT_TRUE(media_playlist_.SetTargetDuration(20));
|
EXPECT_TRUE(media_playlist_.SetTargetDuration(20));
|
||||||
const std::string kExpectedOutput =
|
const std::string kExpectedOutput =
|
||||||
"#EXTM3U\n"
|
"#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\n"
|
||||||
"#EXT-X-TARGETDURATION:20\n"
|
"#EXT-X-TARGETDURATION:20\n"
|
||||||
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
||||||
"#EXT-X-ENDLIST\n";
|
"#EXT-X-ENDLIST\n";
|
||||||
|
@ -197,7 +197,7 @@ TEST_F(MediaPlaylistTest, WriteToFileWithSegments) {
|
||||||
media_playlist_.AddSegment("file2.ts", 2700000, 5000000);
|
media_playlist_.AddSegment("file2.ts", 2700000, 5000000);
|
||||||
const std::string kExpectedOutput =
|
const std::string kExpectedOutput =
|
||||||
"#EXTM3U\n"
|
"#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\n"
|
||||||
"#EXT-X-TARGETDURATION:30\n"
|
"#EXT-X-TARGETDURATION:30\n"
|
||||||
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
||||||
"#EXTINF:10.000,\n"
|
"#EXTINF:10.000,\n"
|
||||||
|
@ -226,7 +226,7 @@ TEST_F(MediaPlaylistTest, WriteToFileWithEncryptionInfo) {
|
||||||
media_playlist_.AddSegment("file2.ts", 2700000, 5000000);
|
media_playlist_.AddSegment("file2.ts", 2700000, 5000000);
|
||||||
const std::string kExpectedOutput =
|
const std::string kExpectedOutput =
|
||||||
"#EXTM3U\n"
|
"#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\n"
|
||||||
"#EXT-X-TARGETDURATION:30\n"
|
"#EXT-X-TARGETDURATION:30\n"
|
||||||
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
||||||
"#EXT-X-KEY:METHOD=SAMPLE-AES,"
|
"#EXT-X-KEY:METHOD=SAMPLE-AES,"
|
||||||
|
@ -258,7 +258,7 @@ TEST_F(MediaPlaylistTest, WriteToFileWithEncryptionInfoEmptyIv) {
|
||||||
media_playlist_.AddSegment("file2.ts", 2700000, 5000000);
|
media_playlist_.AddSegment("file2.ts", 2700000, 5000000);
|
||||||
const std::string kExpectedOutput =
|
const std::string kExpectedOutput =
|
||||||
"#EXTM3U\n"
|
"#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\n"
|
||||||
"#EXT-X-TARGETDURATION:30\n"
|
"#EXT-X-TARGETDURATION:30\n"
|
||||||
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
||||||
"#EXT-X-KEY:METHOD=SAMPLE-AES,"
|
"#EXT-X-KEY:METHOD=SAMPLE-AES,"
|
||||||
|
@ -288,7 +288,7 @@ TEST_F(MediaPlaylistTest, RemoveOldestSegment) {
|
||||||
|
|
||||||
const std::string kExpectedOutput =
|
const std::string kExpectedOutput =
|
||||||
"#EXTM3U\n"
|
"#EXTM3U\n"
|
||||||
"#EXT-X-VERSION:4\n"
|
"#EXT-X-VERSION:5\n"
|
||||||
"#EXT-X-TARGETDURATION:30\n"
|
"#EXT-X-TARGETDURATION:30\n"
|
||||||
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
"#EXT-X-PLAYLIST-TYPE:VOD\n"
|
||||||
"#EXTINF:30.000,\n"
|
"#EXTINF:30.000,\n"
|
||||||
|
|
Loading…
Reference in New Issue