Skip to content

Commit

Permalink
Update PlayerDoc.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakseis committed Aug 22, 2024
1 parent d24b65b commit b308854
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Player/PlayerDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ BEGIN_MESSAGE_MAP(CPlayerDoc, CDocument)
END_MESSAGE_MAP()


const TCHAR szPlayerInitFlags[] = _T("PlayerInitFlags");
const TCHAR szMaximalResolution[] = _T("MaximalResolution");
const TCHAR szUsingSAN[] = _T("UsingSAN");

// CPlayerDoc construction/destruction

CPlayerDoc::CPlayerDoc()
Expand All @@ -350,10 +354,22 @@ CPlayerDoc::CPlayerDoc()
std::bind(&CPlayerDoc::getVideoSpeed, this))))
{
m_frameDecoder->setDecoderListener(this);

if (auto pApp = AfxGetApp())
{
m_maximalResolution = !!pApp->GetProfileInt(szPlayerInitFlags, szMaximalResolution, false);
m_bUsingSAN = !!pApp->GetProfileInt(szPlayerInitFlags, szUsingSAN, true);
}
}

CPlayerDoc::~CPlayerDoc()
{
if (auto pApp = AfxGetApp())
{
pApp->WriteProfileInt(szPlayerInitFlags, szMaximalResolution, m_maximalResolution);
pApp->WriteProfileInt(szPlayerInitFlags, szUsingSAN, m_bUsingSAN);
}

onDestructing();

ASSERT(framePositionChanged.empty());
Expand Down

0 comments on commit b308854

Please sign in to comment.