Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MythPlayer::HasReachedEof(): short circuit the special cases #526

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions mythtv/libs/libmythtv/mythplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,16 +661,13 @@ void MythPlayer::DiscardVideoFrames(bool KeyFrame, bool Flushed)

bool MythPlayer::HasReachedEof(void) const
{
EofState eof = GetEof();
if (eof != kEofStateNone && !m_allPaused)
return true;
if (GetEditMode())
return false;
if (m_liveTV)
return false;
if (!m_deleteMap.IsEmpty() && m_framesPlayed >= m_deleteMap.GetLastFrame())
return true;
return false;
return (GetEof() != kEofStateNone && !m_allPaused);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can return different results than before. Try the combination of eof is kEofStateDelayed, m_allPaused is false, and GetEditMode() is true. Before the change this would return true, after the change it returns false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll have to look into it more deeply, but my intuition is that you wouldn't want to exit because of EOF while editing the recording.

It may also make sense to add:

if (GetEof() == kEofStateImmediate)
    return true;

I'll investigate further.

}

void MythPlayer::DeLimboFrame(MythVideoFrame *frame)
Expand Down