[vlc-commits] macosx: Print warning if user activity declaration failed

David Fuhrmann git at videolan.org
Sun Feb 28 14:50:04 CET 2016


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Feb 28 14:49:10 2016 +0100| [03b3a0eacab637d6a3205f821f101bdaf6226d39] | committer: David Fuhrmann

macosx: Print warning if user activity declaration failed

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03b3a0eacab637d6a3205f821f101bdaf6226d39
---

 modules/gui/macosx/InputManager.m |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/InputManager.m b/modules/gui/macosx/InputManager.m
index ab95990..de4252f 100644
--- a/modules/gui/macosx/InputManager.m
+++ b/modules/gui/macosx/InputManager.m
@@ -294,10 +294,14 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
         if ([o_main activeVideoPlayback] && &IOPMAssertionDeclareUserActivity && shouldDisableScreensaver)
         {
             CFStringRef reasonForActivity = CFStringCreateWithCString(kCFAllocatorDefault, _("VLC media playback"), kCFStringEncodingUTF8);
-            IOPMAssertionDeclareUserActivity(reasonForActivity,
+            IOReturn success = IOPMAssertionDeclareUserActivity(reasonForActivity,
                                              kIOPMUserActiveLocal,
                                              &userActivityAssertionID);
             CFRelease(reasonForActivity);
+
+            if (success != kIOReturnSuccess)
+                msg_Warn(getIntf(), "failed to declare user activity");
+
         }
 #endif
 



More information about the vlc-commits mailing list