Skip to content

Commit

Permalink
hls muxer: add EXT-X-VERSION to primary playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Apr 24, 2022
1 parent 9c20eed commit 3b21da7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/hls/muxer_primary_playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func newMuxerPrimaryPlaylist(
}

p.cnt = []byte("#EXTM3U\n" +
"#EXT-X-VERSION:3\n" +
"\n" +
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"" + strings.Join(codecs, ",") + "\"\n" +
"stream.m3u8\n")

Expand Down
6 changes: 6 additions & 0 deletions internal/hls/muxer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func TestMuxerVideoAudio(t *testing.T) {
require.NoError(t, err)

require.Equal(t, "#EXTM3U\n"+
"#EXT-X-VERSION:3\n"+
"\n"+
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"avc1.010203,mp4a.40.2\"\n"+
"stream.m3u8\n", string(byts))

Expand Down Expand Up @@ -198,6 +200,8 @@ func TestMuxerVideoOnly(t *testing.T) {
require.NoError(t, err)

require.Equal(t, "#EXTM3U\n"+
"#EXT-X-VERSION:3\n"+
"\n"+
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"avc1.010203\"\n"+
"stream.m3u8\n", string(byts))

Expand Down Expand Up @@ -284,6 +288,8 @@ func TestMuxerAudioOnly(t *testing.T) {
require.NoError(t, err)

require.Equal(t, "#EXTM3U\n"+
"#EXT-X-VERSION:3\n"+
"\n"+
"#EXT-X-STREAM-INF:BANDWIDTH=200000,CODECS=\"mp4a.40.2\"\n"+
"stream.m3u8\n", string(byts))

Expand Down

0 comments on commit 3b21da7

Please sign in to comment.