diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-03 00:55:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 00:55:15 +0100 |
commit | 9abb23cd2700b57611fc25bce67581eaa6d4d3b7 (patch) | |
tree | 75a2c41fbdfab51ea44e74e84c17204da171b938 /src/video_core/command_classes/vic.cpp | |
parent | Merge pull request #4937 from german77/multiUDP (diff) | |
parent | Limit queue size to 10 frames (diff) | |
download | yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.gz yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.bz2 yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.lz yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.xz yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.zst yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.zip |
Diffstat (limited to 'src/video_core/command_classes/vic.cpp')
-rw-r--r-- | src/video_core/command_classes/vic.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp index 5b52da277..248443027 100644 --- a/src/video_core/command_classes/vic.cpp +++ b/src/video_core/command_classes/vic.cpp @@ -58,17 +58,18 @@ void Vic::Execute() { return; } const VicConfig config{gpu.MemoryManager().Read<u64>(config_struct_address + 0x20)}; + const AVFramePtr frame_ptr = std::move(nvdec_processor->GetFrame()); + const auto* frame = frame_ptr.get(); + if (!frame || frame->width == 0 || frame->height == 0) { + return; + } const VideoPixelFormat pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value()); switch (pixel_format) { case VideoPixelFormat::BGRA8: case VideoPixelFormat::RGBA8: { LOG_TRACE(Service_NVDRV, "Writing RGB Frame"); - const auto* frame = nvdec_processor->GetFrame(); - if (!frame || frame->width == 0 || frame->height == 0) { - return; - } if (scaler_ctx == nullptr || frame->width != scaler_width || frame->height != scaler_height) { const AVPixelFormat target_format = @@ -121,12 +122,6 @@ void Vic::Execute() { case VideoPixelFormat::Yuv420: { LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame"); - const auto* frame = nvdec_processor->GetFrame(); - - if (!frame || frame->width == 0 || frame->height == 0) { - return; - } - const std::size_t surface_width = config.surface_width_minus1 + 1; const std::size_t surface_height = config.surface_height_minus1 + 1; const std::size_t half_width = surface_width / 2; |