Revert "ffmpeg: Don't ask for multi-threaded decoding"

This reverts commit b173e0f4a4.

Turns out it's not actually known to fix anything, should have closed
that old PR.
This commit is contained in:
Henrik Rydgård 2023-01-12 16:21:41 +01:00
parent ca3303d507
commit 0a13c78788
3 changed files with 8 additions and 3 deletions

View file

@ -521,7 +521,11 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) {
m_pCodecCtx->flags |= AV_CODEC_FLAG_OUTPUT_CORRUPT | AV_CODEC_FLAG_LOW_DELAY;
int openResult = avcodec_open2(m_pCodecCtx, pCodec, nullptr);
AVDictionary *opt = nullptr;
// Allow ffmpeg to use any number of threads it wants. Without this, it doesn't use threads.
av_dict_set(&opt, "threads", "0", 0);
int openResult = avcodec_open2(m_pCodecCtx, pCodec, &opt);
av_dict_free(&opt);
if (openResult < 0) {
return false;
}

View file

@ -107,10 +107,12 @@ bool SimpleAudio::OpenCodec(int block_align) {
codecCtx_->block_align = block_align;
}
int retval = avcodec_open2(codecCtx_, codec_, nullptr);
AVDictionary *opts = 0;
int retval = avcodec_open2(codecCtx_, codec_, &opts);
if (retval < 0) {
ERROR_LOG(ME, "Failed to open codec: retval = %i", retval);
}
av_dict_free(&opts);
codecOpen_ = true;
return retval >= 0;
#else

View file

@ -268,7 +268,6 @@ bool HandleFault(uintptr_t hostAddress, void *ctx) {
}
} else {
type = MemoryExceptionType::UNKNOWN;
}
g_lastMemoryExceptionType = type;