Skip to content

Commit

Permalink
Merge pull request #16799 from hrydgard/ffmpeg-single-threaded
Browse files Browse the repository at this point in the history
ffmpeg: Don't ask for multi-threaded decoding
  • Loading branch information
hrydgard authored Jan 12, 2023
2 parents 449d0a1 + b173e0f commit 5b7239a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions Core/HW/MediaEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,7 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) {

m_pCodecCtx->flags |= AV_CODEC_FLAG_OUTPUT_CORRUPT | AV_CODEC_FLAG_LOW_DELAY;

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);
int openResult = avcodec_open2(m_pCodecCtx, pCodec, nullptr);
if (openResult < 0) {
return false;
}
Expand Down
4 changes: 1 addition & 3 deletions Core/HW/SimpleAudioDec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ bool SimpleAudio::OpenCodec(int block_align) {
codecCtx_->block_align = block_align;
}

AVDictionary *opts = 0;
int retval = avcodec_open2(codecCtx_, codec_, &opts);
int retval = avcodec_open2(codecCtx_, codec_, nullptr);
if (retval < 0) {
ERROR_LOG(ME, "Failed to open codec: retval = %i", retval);
}
av_dict_free(&opts);
codecOpen_ = true;
return retval >= 0;
#else
Expand Down
1 change: 1 addition & 0 deletions Core/MemFault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ bool HandleFault(uintptr_t hostAddress, void *ctx) {
}
} else {
type = MemoryExceptionType::UNKNOWN;

}

g_lastMemoryExceptionType = type;
Expand Down

0 comments on commit 5b7239a

Please sign in to comment.