Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
0b9a93ff
Commit
0b9a93ff
authored
Sep 28, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: simplify system sleep prevention code to support both 10.7.4/10.7.5 and 10.5 (close #7521)
parent
51047a67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
27 deletions
+5
-27
NEWS
NEWS
+2
-3
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-4
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+3
-20
No files found.
NEWS
View file @
0b9a93ff
...
@@ -40,10 +40,9 @@ Mac OS X:
...
@@ -40,10 +40,9 @@ Mac OS X:
* Fix various crashes and small issues including bookmarks, playlist, buttons,
* Fix various crashes and small issues including bookmarks, playlist, buttons,
streaming wizard, video size, hotkeys and fullscreen controller
streaming wizard, video size, hotkeys and fullscreen controller
* Fix font selection for Unicode subtitles
* Fix font selection for Unicode subtitles
* Fix code signing of Delete Preferences application
* Improve system sleep behavior when playing audio-only media. The screen is
* Improve system sleep behavior when playing audio-only media. The screen is
allowed to sleep while the system is kept awake
for the play time
.
allowed to sleep while the system is kept awake
during playback
.
Requires OS X 10.6 or later and a 64bit-capable Mac.
* Fix code signing of Delete Preferences application
Miscellaneous:
Miscellaneous:
* Fix Notify (D-Bus) plugin deadlock.
* Fix Notify (D-Bus) plugin deadlock.
...
...
modules/gui/macosx/intf.h
View file @
0b9a93ff
...
@@ -41,9 +41,7 @@
...
@@ -41,9 +41,7 @@
#import "misc.h"
#import "misc.h"
#import "MainWindow.h"
#import "MainWindow.h"
#ifdef __x86_64__
#import <IOKit/pwr_mgt/IOPMLib.h>
/* for sleep prevention */
#import <IOKit/pwr_mgt/IOPMLib.h>
/* for sleep prevention */
#endif
/*****************************************************************************
/*****************************************************************************
* Local prototypes.
* Local prototypes.
...
@@ -151,10 +149,8 @@ struct intf_sys_t
...
@@ -151,10 +149,8 @@ struct intf_sys_t
NSArray
*
o_usedHotkeys
;
NSArray
*
o_usedHotkeys
;
#ifdef __x86_64__
/* sleep management */
/* sleep management */
IOPMAssertionID
systemSleepAssertionID
;
IOPMAssertionID
systemSleepAssertionID
;
#endif
}
}
+
(
VLCMain
*
)
sharedInstance
;
+
(
VLCMain
*
)
sharedInstance
;
...
...
modules/gui/macosx/intf.m
View file @
0b9a93ff
...
@@ -1553,17 +1553,6 @@ unsigned int CocoaKeyToVLC( unichar i_key )
...
@@ -1553,17 +1553,6 @@ unsigned int CocoaKeyToVLC( unichar i_key )
-
(
void
)
updatePlaybackPosition
-
(
void
)
updatePlaybackPosition
{
{
[
o_mainwindow
updateTimeSlider
];
[
o_mainwindow
updateTimeSlider
];
#ifndef __x86_64__
input_thread_t
*
p_input
;
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
)
{
if
(
var_GetInteger
(
p_input
,
"state"
)
==
PLAYING_S
&&
[
self
activeVideoPlayback
]
)
UpdateSystemActivity
(
UsrActivity
);
vlc_object_release
(
p_input
);
}
#endif
}
}
-
(
void
)
updateVolume
-
(
void
)
updateVolume
...
@@ -1599,21 +1588,17 @@ unsigned int CocoaKeyToVLC( unichar i_key )
...
@@ -1599,21 +1588,17 @@ unsigned int CocoaKeyToVLC( unichar i_key )
int
state
=
var_GetInteger
(
p_input
,
"state"
);
int
state
=
var_GetInteger
(
p_input
,
"state"
);
if
(
state
==
PLAYING_S
)
if
(
state
==
PLAYING_S
)
{
{
#ifdef __x86_64__
/* prevent the system from sleeping using the 10.5 API to be as compatible as possible */
/* prevent the system from sleeping */
IOReturn
success
;
IOReturn
success
;
CFStringRef
reasonForActivity
=
CFStringCreateWithCString
(
kCFAllocatorDefault
,
_
(
"VLC media playback"
),
kCFStringEncodingUTF8
);
if
(
[
self
activeVideoPlayback
]
)
if
(
[
self
activeVideoPlayback
]
)
success
=
IOPMAssertionCreate
WithName
(
kIOPMAssertionTypeNoDisplaySleep
,
kIOPMAssertionLevelOn
,
reasonForActivity
,
&
systemSleepAssertionID
);
success
=
IOPMAssertionCreate
(
kIOPMAssertionTypeNoDisplaySleep
,
kIOPMAssertionLevelOn
,
&
systemSleepAssertionID
);
else
else
success
=
IOPMAssertionCreateWithName
(
kIOPMAssertionTypeNoIdleSleep
,
kIOPMAssertionLevelOn
,
reasonForActivity
,
&
systemSleepAssertionID
);
success
=
IOPMAssertionCreate
(
kIOPMAssertionTypeNoIdleSleep
,
kIOPMAssertionLevelOn
,
&
systemSleepAssertionID
);
CFRelease
(
reasonForActivity
);
if
(
success
==
kIOReturnSuccess
)
if
(
success
==
kIOReturnSuccess
)
msg_Dbg
(
VLCIntf
,
"prevented sleep through IOKit (%i)"
,
systemSleepAssertionID
);
msg_Dbg
(
VLCIntf
,
"prevented sleep through IOKit (%i)"
,
systemSleepAssertionID
);
else
else
msg_Warn
(
VLCIntf
,
"failed to prevent system sleep through IOKit"
);
msg_Warn
(
VLCIntf
,
"failed to prevent system sleep through IOKit"
);
#endif
[[
self
mainMenu
]
setPause
];
[[
self
mainMenu
]
setPause
];
[
o_mainwindow
setPause
];
[
o_mainwindow
setPause
];
...
@@ -1625,11 +1610,9 @@ unsigned int CocoaKeyToVLC( unichar i_key )
...
@@ -1625,11 +1610,9 @@ unsigned int CocoaKeyToVLC( unichar i_key )
[[
self
mainMenu
]
setPlay
];
[[
self
mainMenu
]
setPlay
];
[
o_mainwindow
setPlay
];
[
o_mainwindow
setPlay
];
#ifdef __x86_64__
/* allow the system to sleep again */
/* allow the system to sleep again */
msg_Dbg
(
VLCIntf
,
"releasing sleep blocker (%i)"
,
systemSleepAssertionID
);
msg_Dbg
(
VLCIntf
,
"releasing sleep blocker (%i)"
,
systemSleepAssertionID
);
IOPMAssertionRelease
(
systemSleepAssertionID
);
IOPMAssertionRelease
(
systemSleepAssertionID
);
#endif
}
}
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
}
}
...
...
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