Add workaround for AV1 reinit bug and quiet some debug output
This commit is contained in:
parent
a6f8901a18
commit
85ea28287e
1 changed files with 18 additions and 6 deletions
|
|
@ -663,8 +663,13 @@ bool FFmpegVideoDecoder::completeInitialization(const AVCodec* decoder, enum AVP
|
||||||
|
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
|
|
||||||
// Flush the codec to prepare for the real stream
|
if (!m_TestOnly) {
|
||||||
avcodec_flush_buffers(m_VideoDecoderCtx);
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Test decode successful");
|
||||||
|
|
||||||
|
// Flush the codec to prepare for the real stream
|
||||||
|
avcodec_flush_buffers(m_VideoDecoderCtx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_TestOnly) {
|
if (!m_TestOnly) {
|
||||||
|
|
@ -1076,13 +1081,16 @@ bool FFmpegVideoDecoder::isSeparateTestDecoderRequired(const AVCodec* decoder)
|
||||||
// We know v4l2m2m can't handle this (see comment below), so let's just
|
// We know v4l2m2m can't handle this (see comment below), so let's just
|
||||||
// opt-out all non-hwaccel decoders just to be safe.
|
// opt-out all non-hwaccel decoders just to be safe.
|
||||||
if (qEnvironmentVariableIntValue("SEPARATE_TEST_DECODER")) {
|
if (qEnvironmentVariableIntValue("SEPARATE_TEST_DECODER")) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"Using separate test decoder due to environment variable");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (getAVCodecCapabilities(decoder) & AV_CODEC_CAP_HARDWARE) {
|
else if (getAVCodecCapabilities(decoder) & AV_CODEC_CAP_HARDWARE) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
return true;
|
||||||
"Using separate test decoder for non-hwaccel decoder");
|
}
|
||||||
|
else if (strcmp(decoder->name, "av1") == 0) {
|
||||||
|
// The core AV1 hwaccel decoding code (as of FFmpeg 8.0.1) does
|
||||||
|
// not correctly reinitialize the codec context when the frame
|
||||||
|
// size changes, so always use a separate test decoder for AV1
|
||||||
|
// until this is fixed.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1144,6 +1152,10 @@ bool FFmpegVideoDecoder::tryInitializeRenderer(const AVCodec* decoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (separateTestDecoder) {
|
if (separateTestDecoder) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Not reusing test decoder for %s",
|
||||||
|
decoder->name);
|
||||||
|
|
||||||
// The test worked, so now let's initialize it for real
|
// The test worked, so now let's initialize it for real
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue