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

Conversation

ulmus-scott
Copy link
Contributor

This has no functional change, but is clearer logic.

This has no functional change, but is clearer logic.
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.

@ulmus-scott ulmus-scott marked this pull request as draft May 21, 2022 18:09
@ulmus-scott ulmus-scott deleted the style1 branch May 27, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants