summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-08-08 22:56:40 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-08-16 20:40:53 +0200
commitcd016d3cb5191b9f4f2756e440a6aa67e577c414 (patch)
treee96e08167a350f05feb9c081950be305612d9113 /src/video_core
parentcodec: Improve libav memory alloc and cleanup (diff)
downloadyuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.gz
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.bz2
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.lz
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.xz
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.zst
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/command_classes/codecs/codec.cpp6
-rw-r--r--src/video_core/video_core.cpp3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp
index 18aa40ca3..61966cbfe 100644
--- a/src/video_core/command_classes/codecs/codec.cpp
+++ b/src/video_core/command_classes/codecs/codec.cpp
@@ -5,6 +5,7 @@
#include <fstream>
#include <vector>
#include "common/assert.h"
+#include "common/settings.h"
#include "video_core/command_classes/codecs/codec.h"
#include "video_core/command_classes/codecs/h264.h"
#include "video_core/command_classes/codecs/vp9.h"
@@ -142,8 +143,11 @@ void Codec::Initialize() {
}
}();
av_codec = avcodec_find_decoder(codec);
+
InitializeAvCodecContext();
- InitializeGpuDecoder();
+ if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) {
+ InitializeGpuDecoder();
+ }
if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) {
LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res);
avcodec_free_context(&av_codec_ctx);
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index 3b575db4d..cae543a51 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -37,7 +37,8 @@ std::unique_ptr<VideoCore::RendererBase> CreateRenderer(
namespace VideoCore {
std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system) {
- const bool use_nvdec = Settings::values.use_nvdec_emulation.GetValue();
+ const auto nvdec_value = Settings::values.nvdec_emulation.GetValue();
+ const bool use_nvdec = nvdec_value != Settings::NvdecEmulation::Off;
const bool use_async = Settings::values.use_asynchronous_gpu_emulation.GetValue();
auto gpu = std::make_unique<Tegra::GPU>(system, use_async, use_nvdec);
auto context = emu_window.CreateSharedContext();