Fix some edge case on small MTU devices using qsv codec (#107)

Add fall back logic to prevent edge case where SPS SPP is not included in the same packet and key IDR frame is mislabeled as P frame causing assertion error at validation.
This commit is contained in:
camelcx 2025-07-06 01:13:06 +01:00 committed by GitHub
parent 29f298ec88
commit c86e0537d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -495,10 +495,14 @@ static void reassembleFrame(int frameNumber) {
qdu->decodeUnit.colorspace = (uint8_t)(qdu->decodeUnit.hdrActive ? COLORSPACE_REC_2020 : StreamConfig.colorSpace);
// Invoke the key frame callback if needed
if (qdu->decodeUnit.frameType == FRAME_TYPE_IDR) {
if (nalChainHead->bufferType != BUFFER_TYPE_PICDATA || qdu->decodeUnit.frameType == FRAME_TYPE_IDR) {
qdu->decodeUnit.frameType = FRAME_TYPE_IDR;
notifyKeyFrameReceived();
}
else {
qdu->decodeUnit.frameType = FRAME_TYPE_PFRAME;
}
nalChainHead = nalChainTail = NULL;
nalChainDataLength = 0;