track_h264: avoid appending empty sps to fmtp line (#129)

This avoids adding fmtp lines of the form "sprop-parameter-sets=" with no value.
This commit is contained in:
Tristan Matthews
2022-10-21 10:58:12 -04:00
committed by GitHub
parent e97d29084e
commit 0fd8773b35

View File

@@ -144,7 +144,9 @@ func (t *TrackH264) MediaDescription() *psdp.MediaDescription {
if t.PPS != nil {
tmp = append(tmp, base64.StdEncoding.EncodeToString(t.PPS))
}
fmtp += "; sprop-parameter-sets=" + strings.Join(tmp, ",")
if len(tmp) > 0 {
fmtp += "; sprop-parameter-sets=" + strings.Join(tmp, ",")
}
if len(t.SPS) >= 4 {
fmtp += "; profile-level-id=" + strings.ToUpper(hex.EncodeToString(t.SPS[1:4]))