MPlayer
MPlayer copied to clipboard
Mplayer should disable the Windows screensaver
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.