From d85371cd8cb6304e66ef90a02e2e1609a8621906 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 8 Sep 2026 22:46:11 -0500 Subject: [PATCH] Fix RFI after a multi-block frame loss --- src/RtpVideoQueue.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/RtpVideoQueue.c b/src/RtpVideoQueue.c index adbcd18..0914fe8 100644 --- a/src/RtpVideoQueue.c +++ b/src/RtpVideoQueue.c @@ -617,11 +617,13 @@ int RtpvAddPacket(PRTP_VIDEO_QUEUE queue, PRTP_PACKET packet, int length, PRTPV_ // Notify the host of the loss of this frame if (!queue->reportedLostFrame) { notifyFrameLost(queue->currentFrameNumber, false); - queue->reportedLostFrame = true; } + // NB: We reset reportedLostFrame here because we don't want to suppress + // the reporting of the _next_ frame if it's lost. queue->currentFrameNumber++; queue->multiFecCurrentBlockNumber = 0; + queue->reportedLostFrame = false; return RTPF_RET_REJECTED; } } @@ -652,13 +654,16 @@ int RtpvAddPacket(PRTP_VIDEO_QUEUE queue, PRTP_PACKET packet, int length, PRTPV_ // Notify the host of the loss of this frame if (!queue->reportedLostFrame) { - notifyFrameLost(queue->currentFrameNumber, false); - queue->reportedLostFrame = true; + notifyFrameLost(nvPacket->frameIndex, false); } // We dropped a block of this frame, so we must skip to the next one. + // + // NB: We reset reportedLostFrame here because we don't want to suppress + // the reporting of the _next_ frame if it's lost. queue->currentFrameNumber = nvPacket->frameIndex + 1; queue->multiFecCurrentBlockNumber = 0; + queue->reportedLostFrame = false; return RTPF_RET_REJECTED; }