Browse Source

hls: add fmp4 tests

pull/1128/head
aler9 3 years ago
parent
commit
a018f214bc
  1. 29
      internal/hls/muxer_primary_playlist.go
  2. 1095
      internal/hls/muxer_test.go

29
internal/hls/muxer_primary_playlist.go

@ -50,24 +50,19 @@ func (p *muxerPrimaryPlaylist) file() *MuxerFileResponse { @@ -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"))
}(),
}
}

1095
internal/hls/muxer_test.go

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save