Skip to content

Commit 65eb1a5

Browse files
committed
fix crash.
1 parent 697ed4f commit 65eb1a5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

examples/b2bua/b2bua/buffer/buffer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, o Options) {
126126
b.Lock()
127127
defer b.Unlock()
128128

129+
if len(params.Codecs) == 0 {
130+
return
131+
}
132+
129133
codec := params.Codecs[0]
130134
b.clockRate = codec.ClockRate
131135
b.maxBitrate = o.MaxBitRate

examples/b2bua/b2bua/udp.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ func (c *UdpTansport) onRtpPacket(trackType TrackType, packet []byte, raddr net.
188188
c.buff.Bind(webrtc.RTPParameters{}, buffer.Options{
189189
MaxBitRate: 1500,
190190
})
191-
192191
c.buff.OnFeedback(func(fb []rtcp.Packet) {})
193192
}
194193
c.bmu.Unlock()

0 commit comments

Comments
 (0)