diff options
| author | bunnei <bunneidev@gmail.com> | 2021-02-18 15:12:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-18 15:12:07 -0800 |
| commit | 9cae3e6e90f840903a0072b916e49f24d0f6cb10 (patch) | |
| tree | 79511308066a4fbc11aa2e9058b0aa65772cc30a /src/video_core/command_classes/codecs/codec.cpp | |
| parent | 6686468df046a94ea8bdcedb5f552aed95599147 (diff) | |
| parent | b675c44e494976cf8164203fc826b54e2fac467b (diff) | |
Merge pull request #4973 from ameerj/nvdec-opt
nvdec: Reuse allocated buffers and general cleanup
Diffstat (limited to 'src/video_core/command_classes/codecs/codec.cpp')
| -rw-r--r-- | src/video_core/command_classes/codecs/codec.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index 39bc923a5..d02dc6260 100644 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp @@ -44,8 +44,10 @@ Codec::~Codec() { } void Codec::SetTargetCodec(NvdecCommon::VideoCodec codec) { - LOG_INFO(Service_NVDRV, "NVDEC video codec initialized to {}", codec); - current_codec = codec; + if (current_codec != codec) { + LOG_INFO(Service_NVDRV, "NVDEC video codec initialized to {}", static_cast<u32>(codec)); + current_codec = codec; + } } void Codec::StateWrite(u32 offset, u64 arguments) { @@ -55,7 +57,6 @@ void Codec::StateWrite(u32 offset, u64 arguments) { void Codec::Decode() { bool is_first_frame = false; - if (!initialized) { if (current_codec == NvdecCommon::VideoCodec::H264) { av_codec = avcodec_find_decoder(AV_CODEC_ID_H264); |
