From 0fd8773b35b4c61b51a51885faca92f509a7d305 Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Fri, 21 Oct 2022 10:58:12 -0400 Subject: [PATCH] track_h264: avoid appending empty sps to fmtp line (#129) This avoids adding fmtp lines of the form "sprop-parameter-sets=" with no value. --- track_h264.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/track_h264.go b/track_h264.go index 8ce7a8f0..6e9ef636 100644 --- a/track_h264.go +++ b/track_h264.go @@ -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]))