From a653f4d3e0449476bfa620cda5ef72710480ea84 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 18 Jan 2019 01:50:39 -0800 Subject: [PATCH] Fix IDR frame dropping race condition which seems to occur frequently with GFE 3.17 --- src/VideoDepacketizer.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/VideoDepacketizer.c b/src/VideoDepacketizer.c index 91899b0..47ecd69 100644 --- a/src/VideoDepacketizer.c +++ b/src/VideoDepacketizer.c @@ -582,8 +582,17 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length, unsigned long l // depacketizer will next try to process a non-SOF packet, // and cause it to assert. if (dropStatePending) { - dropFrameState(); - return; + if (nalChainHead && nalChainHead->bufferType != BUFFER_TYPE_PICDATA) { + // Don't drop the frame state if this frame is an IDR frame itself, + // otherwise we'll lose this IDR frame without another in flight + // and have to wait until we hit our consecutive drop limit to + // request a new one (potentially several seconds). + dropStatePending = 0; + } + else { + dropFrameState(); + return; + } } reassembleFrame(frameIndex);