mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 12:32:01 -08:00
hls muxer: fix crash in case of null SPS
This commit is contained in:
parent
f71b7d8967
commit
76d4376476
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue