Skip to content

Commit

Permalink
[EDL] Remove const (fixme implementation)
Browse files Browse the repository at this point in the history
  • Loading branch information
enen92 committed Jun 22, 2024
1 parent f2b3913 commit b446e55
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 33 deletions.
22 changes: 11 additions & 11 deletions xbmc/cores/VideoPlayer/Edl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void CEdl::Clear()
m_lastEditTime = -1;
}

bool CEdl::ReadEditDecisionLists(const CFileItem& fileItem, const float fFramesPerSecond)
bool CEdl::ReadEditDecisionLists(const CFileItem& fileItem, float fps)
{
bool bFound = false;

Expand All @@ -66,10 +66,10 @@ bool CEdl::ReadEditDecisionLists(const CFileItem& fileItem, const float fFramesP
bFound = ReadVideoReDo(strMovie);

if (!bFound)
bFound = ReadEdl(strMovie, fFramesPerSecond);
bFound = ReadEdl(strMovie, fps);

if (!bFound)
bFound = ReadComskip(strMovie, fFramesPerSecond);
bFound = ReadComskip(strMovie, fps);

if (!bFound)
bFound = ReadBeyondTV(strMovie);
Expand All @@ -88,7 +88,7 @@ bool CEdl::ReadEditDecisionLists(const CFileItem& fileItem, const float fFramesP
return bFound;
}

bool CEdl::ReadEdl(const std::string& strMovie, const float fFramesPerSecond)
bool CEdl::ReadEdl(const std::string& strMovie, float fps)
{
Clear();

Expand Down Expand Up @@ -190,10 +190,10 @@ bool CEdl::ReadEdl(const std::string& strMovie, const float fFramesPerSecond)
}
else if (strFields[i][0] == '#') // #12345 format for frame number
{
if (fFramesPerSecond > 0.0f)
if (fps > 0.0f)
{
editStartEnd[i] = static_cast<int64_t>(std::atol(strFields[i].substr(1).c_str()) /
fFramesPerSecond * 1000); // frame number to ms
editStartEnd[i] = static_cast<int64_t>(std::atol(strFields[i].substr(1).c_str()) / fps *
1000); // frame number to ms
}
else
{
Expand Down Expand Up @@ -281,7 +281,7 @@ bool CEdl::ReadEdl(const std::string& strMovie, const float fFramesPerSecond)
}
}

bool CEdl::ReadComskip(const std::string& strMovie, const float fFramesPerSecond)
bool CEdl::ReadComskip(const std::string& strMovie, float fps)
{
Clear();

Expand Down Expand Up @@ -315,9 +315,9 @@ bool CEdl::ReadComskip(const std::string& strMovie, const float fFramesPerSecond
/*
* Not all generated Comskip files have the frame rate information.
*/
if (fFramesPerSecond > 0.0f)
if (fps > 0.0f)
{
fFrameRate = fFramesPerSecond;
fFrameRate = fps;
CLog::Log(LOGWARNING,
"Edl::ReadComskip - Frame rate not in Comskip file. Using detected frames per "
"second: {:.3f}",
Expand Down Expand Up @@ -707,7 +707,7 @@ bool CEdl::AddEdit(const Edit& newEdit)
return true;
}

bool CEdl::AddSceneMarker(const int iSceneMarker)
bool CEdl::AddSceneMarker(int iSceneMarker)
{
Edit edit;

Expand Down
29 changes: 7 additions & 22 deletions xbmc/cores/VideoPlayer/Edl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ class CEdl
public:
CEdl();

// FIXME: remove const modifier for fFramesPerSecond as it makes no sense as it means nothing
// for the reader of the interface, but limits the implementation
// to not modify the parameter on stack
bool ReadEditDecisionLists(const CFileItem& fileItem, const float fFramesPerSecond);
bool ReadEditDecisionLists(const CFileItem& fileItem, float fps);
void Clear();

/*!
Expand Down Expand Up @@ -170,21 +167,12 @@ class CEdl
*/
EDL::Action m_lastEditActionType{EDL::EDL_ACTION_NONE};

// FIXME: remove const modifier for fFramesPerSecond as it makes no sense as it means nothing
// for the reader of the interface, but limits the implementation
// to not modify the parameter on stack
bool ReadEdl(const std::string& strMovie, const float fFramesPerSecond);
// FIXME: remove const modifier for fFramesPerSecond as it makes no sense as it means nothing
// for the reader of the interface, but limits the implementation
// to not modify the parameter on stack
bool ReadComskip(const std::string& strMovie, const float fFramesPerSecond);
// FIXME: remove const modifier for strMovie as it makes no sense as it means nothing
// for the reader of the interface, but limits the implementation
// to not modify the parameter on stack
bool ReadEdl(const std::string& strMovie, float fps);

bool ReadComskip(const std::string& strMovie, float fps);

bool ReadVideoReDo(const std::string& strMovie);
// FIXME: remove const modifier for strMovie as it makes no sense as it means nothing
// for the reader of the interface, but limits the implementation
// to not modify the parameter on stack

bool ReadBeyondTV(const std::string& strMovie);
bool ReadPvr(const CFileItem& fileItem);

Expand All @@ -195,10 +183,7 @@ class CEdl
*/
bool AddEdit(const EDL::Edit& newEdit);

// FIXME: remove const modifier for strMovie as it makes no sense as it means nothing
// for the reader of the interface, but limits the implementation
// to not modify the parameter on stack
bool AddSceneMarker(const int sceneMarker);
bool AddSceneMarker(int sceneMarker);

void MergeShortCommBreaks();

Expand Down

0 comments on commit b446e55

Please sign in to comment.