Print the frame number if decoding fails

This commit is contained in:
Cameron Gutman 2022-10-04 23:38:54 -05:00
commit bc68aad67b
3 changed files with 25 additions and 17 deletions

View file

@ -123,8 +123,9 @@ SLVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
err = SLVideo_BeginFrame(m_VideoStream, du->fullLength);
if (err < 0) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"SLVideo_BeginFrame() failed: %d",
err);
"SLVideo_BeginFrame() failed: %d (frame %d)",
err,
du->frameNumber);
// Need an IDR frame to resync
return DR_NEED_IDR;
@ -137,8 +138,9 @@ SLVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
entry->length);
if (err < 0) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"SLVideo_WriteFrameData() failed: %d",
err);
"SLVideo_WriteFrameData() failed: %d (frame %d)",
err,
du->frameNumber);
// Need an IDR frame to resync
return DR_NEED_IDR;
@ -150,8 +152,9 @@ SLVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
err = SLVideo_SubmitFrame(m_VideoStream);
if (err < 0) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"SLVideo_SubmitFrame() failed: %d",
err);
"SLVideo_SubmitFrame() failed: %d (frame %d)",
err,
du->frameNumber);
// Need an IDR frame to resync
return DR_NEED_IDR;