Checkpoint audio-only Skald fork work

This commit is contained in:
Storm Dragon
2026-05-18 13:06:57 -04:00
parent a8ada950d5
commit 965347cad4
48 changed files with 1080 additions and 3651 deletions
+8 -24
View File
@@ -105,7 +105,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) {
func (wp *rtpWriterPool) write(seqno uint16, index uint16, delay uint32, marker bool) {
pi := packetIndex{seqno, index}
var dead []*rtpWriter
@@ -127,15 +127,7 @@ func (wp *rtpWriterPool) write(seqno uint16, index uint16, delay uint32, isvideo
// the writer is dead.
dead = append(dead, w)
default:
// the writer is congested
if isvideo {
// drop until the end of the frame
if !marker {
w.drop = 7
}
continue
}
// audio, try again with a delay
// the writer is congested, try again with a delay
d := delay / uint32(2*len(wp.writers))
timer := time.NewTimer(rtptime.ToDuration(
int64(d), rtptime.JiffiesPerSec,
@@ -256,20 +248,12 @@ func rtpWriterLoop(writer *rtpWriter, track *rtpUpTrack) {
}
last, foundLast := track.cache.Last()
kf, foundKf := track.cache.Keyframe()
if foundLast && foundKf {
if last-kf < 40 { // modulo 2^16
go sendSequence(
kf, last,
action.track,
track.cache,
)
} else {
track.RequestKeyframe()
}
} else {
// no keyframe yet, one should
// arrive soon. Do nothing.
if foundLast {
go sendSequence(
last, last,
action.track,
track.cache,
)
}
} else {
found := false