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

Mplayer should disable the Windows screensaver #13

Open
ujos opened this issue Jun 5, 2021 · 0 comments
Open

Mplayer should disable the Windows screensaver #13

ujos opened this issue Jun 5, 2021 · 0 comments

Comments

@ujos
Copy link

ujos commented Jun 5, 2021

During the video playback the MPlayer should disable the screensaver.

Following is the code how to disable the screensaver:

if( !SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED)) {
  DWORD err = GetLastError();
  std::cerr << "[ERROR] Cannot disable the screensaver. Code=" << err 
    << ". " << std::system_category().message(err) << "\n";
}

The issue applies to the video playback only as in case if audio content is playing, Windows automatically locks the ES_SYSTEM_REQUIRED. Thus just for the clarity, in case if -novideo key is provided, application should not lock the display.

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

No branches or pull requests

1 participant