Commit d904d698 authored by gbazin's avatar gbazin

* modules/video_output/directx/events.c: prevent monitor power down when the...

* modules/video_output/directx/events.c: prevent monitor power down when the directx vout is running.
parent d947fa60
......@@ -84,6 +84,7 @@ void DirectXEventThread( event_thread_t *p_event )
POINT old_mouse_pos = {0,0};
vlc_value_t val;
int i_width, i_height, i_x, i_y;
HMODULE hkernel32;
/* Initialisation */
p_event->p_vout->pf_control = Control;
......@@ -100,6 +101,21 @@ void DirectXEventThread( event_thread_t *p_event )
/* Signal the creation of the window */
vlc_thread_ready( p_event );
/* Set power management stuff */
if( (hkernel32 = GetModuleHandle( "KERNEL32" ) ) )
{
ULONG (WINAPI* OurSetThreadExecutionState)( ULONG );
OurSetThreadExecutionState =
GetProcAddress( hkernel32, "SetThreadExecutionState" );
if( OurSetThreadExecutionState )
/* Prevent monitor from powering off */
OurSetThreadExecutionState( ES_DISPLAY_REQUIRED );
else
msg_Dbg( p_event, "no support for SetThreadExecutionState()" );
}
/* Main loop */
/* GetMessage will sleep if there's no message in the queue */
while( !p_event->b_die && ( p_event->p_vout->p_sys->hparent ||
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment