mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Video: Enable threads for video decoding.
This was previously getting (accidentally?) enabled by the call to `avformat_find_stream_info()`. See #9262.
This commit is contained in:
parent
d408b9980a
commit
7a7e4ed23f
1 changed files with 8 additions and 4 deletions
|
@ -458,14 +458,18 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) {
|
|||
|
||||
// Find the decoder for the video stream
|
||||
AVCodec *pCodec = avcodec_find_decoder(m_pCodecCtx->codec_id);
|
||||
if (pCodec == NULL) {
|
||||
if (pCodec == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Open codec
|
||||
if (avcodec_open2(m_pCodecCtx, pCodec, nullptr) < 0) {
|
||||
return false; // Could not open codec
|
||||
AVDictionary *opt = nullptr;
|
||||
av_dict_set(&opt, "threads", "0", 0);
|
||||
int openResult = avcodec_open2(m_pCodecCtx, pCodec, &opt);
|
||||
av_dict_free(&opt);
|
||||
if (openResult < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pCodecCtxs[streamNum] = m_pCodecCtx;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue