From 641ca6ba827173229278c5c4a53bd6cb912ac294 Mon Sep 17 00:00:00 2001 From: Hu Chunming <2657262686@qq.com> Date: Tue, 23 Jul 2024 11:52:00 +0800 Subject: [PATCH] 修复任务创建失败时的显存泄漏 --- src/decoder/dvpp/DvppDecoder.cpp | 6 +++--- src/decoder/dvpp/DvppStreamDecoder.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/decoder/dvpp/DvppDecoder.cpp b/src/decoder/dvpp/DvppDecoder.cpp index 251ff30..8f17bb1 100644 --- a/src/decoder/dvpp/DvppDecoder.cpp +++ b/src/decoder/dvpp/DvppDecoder.cpp @@ -328,13 +328,13 @@ int DvppDecoder::getVdecType(int videoType, int profile) aclError ret = aclrtSetDevice(m_dvpp_deviceId); if(ret != ACL_ERROR_NONE){ LOG_ERROR("[{}]-aclrtSetDevice failed !", m_dec_name); - return false; + break; } ret = aclrtCreateContext(&m_context, m_dvpp_deviceId); if (ret != ACL_ERROR_NONE) { LOG_ERROR("[{}]-aclrtCreateContext failed !", m_dec_name); - return false; + break; } // DvppSourceManager 创建时包含 aclInit,析构时包含 aclFinalize @@ -342,7 +342,7 @@ int DvppDecoder::getVdecType(int videoType, int profile) m_dvpp_channel = pSrcMgr->getChannel(m_dvpp_deviceId); if(m_dvpp_channel < 0){ LOG_ERROR("[{}]-该设备channel已经用完了!", m_dec_name); - return false; + break; } m_vpcUtils.init(m_dvpp_deviceId); diff --git a/src/decoder/dvpp/DvppStreamDecoder.cpp b/src/decoder/dvpp/DvppStreamDecoder.cpp index cf82ede..5b00f77 100644 --- a/src/decoder/dvpp/DvppStreamDecoder.cpp +++ b/src/decoder/dvpp/DvppStreamDecoder.cpp @@ -55,7 +55,7 @@ DvppStreamDecoder::~DvppStreamDecoder() { Close(); - LOG_DEBUG("[{}]- ~DvppDecoder() in_count:{} out_count:{}", m_dec_name, m_in_count, m_out_count); + LOG_DEBUG("[{}]- ~DvppStreamDecoder() in_count:{} out_count:{}", m_dec_name, m_in_count, m_out_count); } bool DvppStreamDecoder::Init(FFDecConfig cfg) { -- libgit2 0.21.4