From d6dc6e9d642f921f11ed00d99861beba319d98f8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 21 Feb 2021 09:05:06 -0800 Subject: [PATCH] Mpeg: Set low latency flag for video decode. --- Core/HLE/sceMpeg.cpp | 2 ++ Core/HW/MediaEngine.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 37e500ebb9..cc0452c94f 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -805,6 +805,8 @@ static bool InitPmp(MpegContext * ctx){ return false; } + pmp_CodecCtx->flags |= AV_CODEC_FLAG_OUTPUT_CORRUPT | AV_CODEC_FLAG_LOW_DELAY; + // each pmp video context is corresponding to one pmp video codec mediaengine->m_pCodecCtxs[0] = pmp_CodecCtx; diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 5b64f4a07a..50a33604cc 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -542,6 +542,8 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) { } #endif + 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);