Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
b50e681d
Commit
b50e681d
authored
Nov 28, 2005
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directx.c: disable screensaver by temporarily resetting screensaver system settings
parent
77d3ea57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
modules/video_output/directx/directx.c
modules/video_output/directx/directx.c
+39
-0
No files found.
modules/video_output/directx/directx.c
View file @
b50e681d
...
...
@@ -238,6 +238,7 @@ static int OpenVideo( vlc_object_t *p_this )
var_Create
(
p_vout
,
"directx-3buffering"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"directx-device"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"disable-screensaver"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
p_vout
->
p_sys
->
b_cursor_hidden
=
0
;
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
...
...
@@ -304,6 +305,30 @@ static int OpenVideo( vlc_object_t *p_this )
var_Get
(
p_vout
,
"directx-wallpaper"
,
&
val
);
var_Set
(
p_vout
,
"directx-wallpaper"
,
val
);
/* disable screensaver by temporarily changing system settings */
p_vout
->
p_sys
->
i_spi_lowpowertimeout
=
0
;
p_vout
->
p_sys
->
i_spi_powerofftimeout
=
0
;
p_vout
->
p_sys
->
i_spi_screensavetimeout
=
0
;
var_Get
(
p_vout
,
"disable-screensaver"
,
&
val
);
if
(
val
.
b_bool
)
{
msg_Dbg
(
p_vout
,
"disabling screen saver"
);
SystemParametersInfo
(
SPI_GETLOWPOWERTIMEOUT
,
0
,
&
(
p_vout
->
p_sys
->
i_spi_lowpowertimeout
),
0
);
if
(
0
!=
p_vout
->
p_sys
->
i_spi_lowpowertimeout
)
{
SystemParametersInfo
(
SPI_SETLOWPOWERTIMEOUT
,
0
,
NULL
,
0
);
}
SystemParametersInfo
(
SPI_GETPOWEROFFTIMEOUT
,
0
,
&
(
p_vout
->
p_sys
->
i_spi_powerofftimeout
),
0
);
if
(
0
!=
p_vout
->
p_sys
->
i_spi_powerofftimeout
)
{
SystemParametersInfo
(
SPI_SETPOWEROFFTIMEOUT
,
0
,
NULL
,
0
);
}
SystemParametersInfo
(
SPI_GETSCREENSAVETIMEOUT
,
0
,
&
(
p_vout
->
p_sys
->
i_spi_screensavetimeout
),
0
);
if
(
0
!=
p_vout
->
p_sys
->
i_spi_screensavetimeout
)
{
SystemParametersInfo
(
SPI_SETSCREENSAVETIMEOUT
,
0
,
NULL
,
0
);
}
}
return
VLC_SUCCESS
;
error:
...
...
@@ -469,6 +494,20 @@ static void CloseVideo( vlc_object_t *p_this )
/* Make sure the wallpaper is restored */
SwitchWallpaperMode
(
p_vout
,
VLC_FALSE
);
/* restore screensaver system settings */
if
(
0
!=
p_vout
->
p_sys
->
i_spi_lowpowertimeout
)
{
SystemParametersInfo
(
SPI_SETLOWPOWERTIMEOUT
,
p_vout
->
p_sys
->
i_spi_lowpowertimeout
,
NULL
,
0
);
}
if
(
0
!=
p_vout
->
p_sys
->
i_spi_powerofftimeout
)
{
SystemParametersInfo
(
SPI_SETPOWEROFFTIMEOUT
,
p_vout
->
p_sys
->
i_spi_powerofftimeout
,
NULL
,
0
);
}
if
(
0
!=
p_vout
->
p_sys
->
i_spi_screensavetimeout
)
{
SystemParametersInfo
(
SPI_SETSCREENSAVETIMEOUT
,
p_vout
->
p_sys
->
i_spi_screensavetimeout
,
NULL
,
0
);
}
if
(
p_vout
->
p_sys
)
{
free
(
p_vout
->
p_sys
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment