Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Commit 0db73aa

Browse files
LightnyInteldmitryermilov
authored andcommitted
[HEVCe/lib] Fix kw issue for unique pointer reset and initialization
1.Defer unique pointer reset after the argument be used 2.Change variable Initialization from constructor to declaration
1 parent 671fd7e commit 0db73aa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_alloc.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ IAllocation* Allocator::MakeAlloc(std::unique_ptr<MfxEncodeHW::ResPool>&& upAllo
5555
return nullptr;
5656

5757
auto pAlloc = upAlloc.release();
58-
pIAlloc->m_pthis.reset(pAlloc);
5958

6059
#define WRAP_CC(X) pIAlloc->X.Push(WrapCC(&MfxEncodeHW::ResPool::X, pAlloc))
6160
WRAP_CC(Alloc);
@@ -69,6 +68,8 @@ IAllocation* Allocator::MakeAlloc(std::unique_ptr<MfxEncodeHW::ResPool>&& upAllo
6968
WRAP_CC(UnlockAll);
7069
WRAP_CC(Acquire);
7170

71+
pIAlloc->m_pthis.reset(pAlloc);
72+
7273
return pIAlloc.release();
7374
}
7475

_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_impl.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ using namespace HEVCEHW::Base;
4646

4747
MFXVideoENCODEH265_HW::MFXVideoENCODEH265_HW(VideoCORE& core)
4848
: m_core(core)
49-
, m_runtimeErr(MFX_ERR_NONE)
5049
{
5150
}
5251

_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ namespace Base
119119
VideoCORE& m_core;
120120
TFeatureList m_features;
121121
StorageRW m_storage;
122-
mfxStatus m_runtimeErr;
122+
mfxStatus m_runtimeErr = MFX_ERR_NONE;
123123

124124
mfxStatus Execute(mfxThreadTask task, mfxU32 uid_p, mfxU32 uid_a);
125125
mfxStatus FreeResources(mfxThreadTask task, mfxStatus sts);

0 commit comments

Comments
 (0)