hls: add fmp4 tests

This commit is contained in:
aler9 2022-08-27 16:00:08 +02:00
parent 43dc57716b
commit a018f214bc
2 changed files with 780 additions and 296 deletions

View file

@ -50,24 +50,19 @@ func (p *muxerPrimaryPlaylist) file() *MuxerFileResponse {
codecs = append(codecs, "mp4a.40."+strconv.FormatInt(int64(p.audioTrack.Config.Type), 10))
}
switch {
case !p.fmp4:
return bytes.NewReader([]byte("#EXTM3U\n" +
"#EXT-X-VERSION:3\n" +
"#EXT-X-INDEPENDENT-SEGMENTS\n" +
"\n" +
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"" + strings.Join(codecs, ",") + "\"\n" +
"stream.m3u8\n"))
default:
return bytes.NewReader([]byte("#EXTM3U\n" +
"#EXT-X-VERSION:9\n" +
"#EXT-X-INDEPENDENT-SEGMENTS\n" +
"\n" +
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"" + strings.Join(codecs, ",") + "\"\n" +
"stream.m3u8\n" +
"\n"))
var version int
if !p.fmp4 {
version = 3
} else {
version = 9
}
return bytes.NewReader([]byte("#EXTM3U\n" +
"#EXT-X-VERSION:" + strconv.FormatInt(int64(version), 10) + "\n" +
"#EXT-X-INDEPENDENT-SEGMENTS\n" +
"\n" +
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"" + strings.Join(codecs, ",") + "\"\n" +
"stream.m3u8\n"))
}(),
}
}

File diff suppressed because it is too large Load diff