change track initialization method

This commit is contained in:
aler9
2022-06-23 13:13:36 +02:00
parent 3223af460e
commit 9f4fea8a01
40 changed files with 765 additions and 706 deletions

View File

@@ -81,11 +81,13 @@ func main() {
defer h264dec.close()
// if present, send SPS and PPS from the SDP to the decoder
if h264track.SPS() != nil {
h264dec.decode(h264track.SPS())
sps := h264track.SafeSPS()
if sps != nil {
h264dec.decode(sps)
}
if h264track.PPS() != nil {
h264dec.decode(h264track.PPS())
pps := h264track.SafePPS()
if pps != nil {
h264dec.decode(pps)
}
// called when a RTP packet arrives