Commit 1fe64e15 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove packet pacing.

It's not obvious that it's useful, especially now that the writer
is split into multiple threads.  Do retain the dynamically computed
delay in case of audio congestion.
parent 96dbcd9d
......@@ -17,8 +17,6 @@ type packetIndex struct {
seqno uint16
// the index in the cache
index uint16
// the expected delay until the next packet, in jiffies
delay uint32
}
// An rtpWriterPool is a set of rtpWriters
......@@ -109,7 +107,7 @@ func (wp *rtpWriterPool) close() {
// write writes a packet stored in the packet cache to all local tracks
func (wp *rtpWriterPool) write(seqno uint16, index uint16, delay uint32, isvideo bool, marker bool) {
pi := packetIndex{seqno, index, delay}
pi := packetIndex{seqno, index}
var dead []*rtpWriter
for _, w := range wp.writers {
......@@ -143,11 +141,6 @@ func (wp *rtpWriterPool) write(seqno uint16, index uint16, delay uint32, isvideo
timer := time.NewTimer(rtptime.ToDuration(
uint64(d), rtptime.JiffiesPerSec,
))
if pi.delay > d {
pi.delay -= d
} else {
pi.delay = 0
}
select {
case w.ch <- pi:
......@@ -286,14 +279,6 @@ func rtpWriterLoop(writer *rtpWriter, conn *rtpUpConnection, track *rtpUpTrack)
continue
}
var delay time.Duration
if len(local) > 0 {
delay = rtptime.ToDuration(
uint64(pi.delay/uint32(len(local))),
rtptime.JiffiesPerSec,
)
}
kfNeeded := false
for _, l := range local {
err := l.WriteRTP(&packet)
......@@ -304,9 +289,6 @@ func rtpWriterLoop(writer *rtpWriter, conn *rtpUpConnection, track *rtpUpTrack)
continue
}
l.Accumulate(uint32(bytes))
if delay > 0 {
time.Sleep(delay)
}
}
if kfNeeded {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment