Fix packet handling in WriteToTrack to ensure proper processing of next packets on timeout and empty data

This commit is contained in:
Cédric Verstraeten
2025-06-06 13:36:30 +00:00
parent 40f65a30b3
commit c4453bb8b3

View File

@@ -433,11 +433,13 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
if config.Capture.ForwardWebRTC == "true" && (hasTimedOut || hasNoPeers) {
start = false
receivedKeyFrame = false
pkt = nextPkt
continue
}
if len(pkt.Data) == 0 || pkt.Data == nil {
receivedKeyFrame = false
pkt = nextPkt
continue
}
@@ -445,6 +447,7 @@ func WriteToTrack(livestreamCursor *packets.QueueCursor, configuration *models.C
if pkt.IsKeyFrame {
receivedKeyFrame = true
} else {
pkt = nextPkt
continue
}
}