[vlc-devel] [PATCH] [PATCH] playlist: allow monitor energy saving mode on windwos

Filip Roséen filip at atch.se
Tue Mar 28 10:26:14 CEST 2017


Hi Andrei,

Your preprocessor directives are not standard compliant, I am not sure
what preprocessor that accepts such blocks; but we cannot have such in
the codebase.

I have honestly not stumbled across a preprocessor that would allow
a `#if`-directive without a corresponding `#endif`, so out of
curiosity;

 - what preprocessor is it that accepts `#if` with a block denoted by
   `{` and `}` without a closing `#endif`?

On 2017-03-28 09:56, andrei.ciurea96 at gmail.com wrote:

> From: Andrei Ciurea <andrei.ciurea96 at gmail.com>
> 
> ---
>  src/playlist/control.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/src/playlist/control.c b/src/playlist/control.c
> index 2da525a2d6..afb5a88aca 100644
> --- a/src/playlist/control.c
> +++ b/src/playlist/control.c
> @@ -25,6 +25,11 @@
>  # include "config.h"
>  #endif
>  
> + #if (_WIN32)
> + {
> +    #include <windows.h>   
> + }
> +
>  #include <vlc_common.h>
>  #include "vlc_playlist.h"
>  #include "playlist_internal.h"
> @@ -107,12 +112,20 @@ static void playlist_vaControl( playlist_t *p_playlist, int i_query,
>              pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist );
>              pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist );
>              pl_priv(p_playlist)->request.i_skip = 0;
> +            #if (_WIN32)
> +            {
> +                SetThreadExecutionState?( ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED | ES_CONTINUOUS );
> +            }
>          }
> -        else
> +        else{
>          if( var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S )
>              var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S );
>          else
>              var_SetInteger( pl_priv(p_playlist)->p_input, "state", PAUSE_S );
> +        #if(_WIN32){
> +            SetThreadExecutionState?( ES_SYSTEM_REQUIRED | ES_CONTINUOUS );
> +        }
> +    }
>          break;
>  
>      case PLAYLIST_SKIP:
> -- 
> 2.11.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170328/8f49eddf/attachment.html>


More information about the vlc-devel mailing list