Skip to content

Commit

Permalink
Set thread execution state
Browse files Browse the repository at this point in the history
prevent Windows from falling into standby
  • Loading branch information
lordmulder authored and msg7086 committed Feb 26, 2015
1 parent 4ae6189 commit 7aa40cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x264.c
Expand Up @@ -434,6 +434,7 @@ int main( int argc, char **argv )
_setmode( _fileno( stdin ), _O_BINARY );
_setmode( _fileno( stdout ), _O_BINARY );
_setmode( _fileno( stderr ), _O_BINARY );
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED);
#endif

/* Parse command line */
Expand Down Expand Up @@ -466,6 +467,7 @@ int main( int argc, char **argv )
#ifdef _WIN32
SetConsoleTitleW( org_console_title );
free( argv );
SetThreadExecutionState(ES_CONTINUOUS);
#endif

x264_log_done();
Expand Down

0 comments on commit 7aa40cd

Please sign in to comment.