Use new LiRequestIdrFrame() API

This commit is contained in:
Cameron Gutman
2022-10-05 00:53:31 -05:00
parent f8c7e2ee41
commit fbbbd5e0b8
4 changed files with 7 additions and 22 deletions

View File

@@ -1108,6 +1108,10 @@ void FFmpegVideoDecoder::decoderThreadProc()
// Don't consume any additional data
SDL_AtomicSet(&m_DecoderThreadShouldQuit, 1);
}
// Just in case the error resulted in the loss of the frame,
// request an IDR frame to reset our decoder state.
LiRequestIdrFrame();
}
} while (err == AVERROR(EAGAIN) && !SDL_AtomicGet(&m_DecoderThreadShouldQuit));
@@ -1131,11 +1135,6 @@ int FFmpegVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
return DR_NEED_IDR;
}
// Bail immediately if we need an IDR frame to continue
if (Session::get()->getAndClearPendingIdrFrameStatus()) {
return DR_NEED_IDR;
}
if (!m_LastFrameNumber) {
m_ActiveWndVideoStats.measurementStartTimestamp = SDL_GetTicks();
m_LastFrameNumber = du->frameNumber;