mirror of
https://github.com/livekit/livekit.git
synced 2026-07-30 22:39:53 +00:00
code clean & fix h264 test fail (#1028)
This commit is contained in:
@@ -197,7 +197,6 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapabili
|
||||
case webrtc.TypeRTCPFBNACK:
|
||||
b.logger.Debugw("Setting feedback", "type", webrtc.TypeRTCPFBNACK)
|
||||
b.nacker = NewNACKQueue()
|
||||
b.nacker.SetRTT(70) // default till it is updated
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,15 +520,11 @@ func (b *Buffer) doReports(arrivalTime int64) {
|
||||
|
||||
func (b *Buffer) buildNACKPacket() ([]rtcp.Packet, int) {
|
||||
if nacks, numSeqNumsNacked := b.nacker.Pairs(); len(nacks) > 0 {
|
||||
var pkts []rtcp.Packet
|
||||
if len(nacks) > 0 {
|
||||
pkts = []rtcp.Packet{&rtcp.TransportLayerNack{
|
||||
SenderSSRC: b.mediaSSRC,
|
||||
MediaSSRC: b.mediaSSRC,
|
||||
Nacks: nacks,
|
||||
}}
|
||||
}
|
||||
|
||||
pkts := []rtcp.Packet{&rtcp.TransportLayerNack{
|
||||
SenderSSRC: b.mediaSSRC,
|
||||
MediaSSRC: b.mediaSSRC,
|
||||
Nacks: nacks,
|
||||
}}
|
||||
return pkts, numSeqNumsNacked
|
||||
}
|
||||
return nil, 0
|
||||
|
||||
@@ -24,6 +24,7 @@ type NackQueue struct {
|
||||
func NewNACKQueue() *NackQueue {
|
||||
return &NackQueue{
|
||||
nacks: make([]*nack, 0, cacheSize),
|
||||
rtt: 70,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ func (w *TrackWriter) Stop() {
|
||||
func (w *TrackWriter) writeNull() {
|
||||
defer w.onWriteComplete()
|
||||
sample := media.Sample{Data: []byte{0x0, 0xff, 0xff, 0xff, 0xff}, Duration: 30 * time.Millisecond}
|
||||
h264Sample := media.Sample{Data: []byte{0x5, 0xff, 0xff, 0xff, 0xff}, Duration: 30 * time.Millisecond}
|
||||
h264Sample := media.Sample{Data: []byte{0x00, 0x00, 0x00, 0x01, 0x7, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x5, 0xff, 0xff, 0xff, 0xff}, Duration: 30 * time.Millisecond}
|
||||
for {
|
||||
select {
|
||||
case <-time.After(20 * time.Millisecond):
|
||||
|
||||
Reference in New Issue
Block a user