mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-11 01:19:35 +00:00
hls muxer: fix crash in case of null SPS
This commit is contained in:
parent
f71b7d8967
commit
76d4376476
@ -29,7 +29,10 @@ func newMuxerPrimaryPlaylist(
|
||||
var codecs []string
|
||||
|
||||
if p.videoTrack != nil {
|
||||
codecs = append(codecs, "avc1."+hex.EncodeToString(p.videoTrack.SPS()[1:4]))
|
||||
sps := p.videoTrack.SPS()
|
||||
if len(sps) >= 4 {
|
||||
codecs = append(codecs, "avc1."+hex.EncodeToString(sps[1:4]))
|
||||
}
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter
|
||||
|
Loading…
Reference in New Issue
Block a user