]> git.sesse.net Git - vlc/blobdiff - modules/misc/inhibit.c
Add a global documentation for all the Lua modules.
[vlc] / modules / misc / inhibit.c
index 0985ad126250244590b29af0e4f547fede9f78d0..b2c590fd471a9b4b3fd56e9000984d8f822cca03 100644 (file)
@@ -34,7 +34,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_interface.h>
 
@@ -62,7 +63,7 @@ struct intf_sys_t
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    set_description( _("Power Management Inhibitor") );
+    set_description( N_("Power Management Inhibitor") );
     set_capability( "interface", 0 );
     set_callbacks( Activate, Deactivate );
 vlc_module_end();
@@ -226,13 +227,12 @@ static int UnInhibit( intf_thread_t *p_intf )
 static void Run( intf_thread_t *p_intf )
 {
     vlc_object_lock( p_intf );
-    for(;;)
+    while( vlc_object_alive( p_intf ) )
     {
         input_thread_t *p_input;
 
         /* Check playing state every 30 seconds */
-        if( vlc_object_timedwait( p_intf, mdate() + 30000000 ) < 0 )
-            break;
+        vlc_object_timedwait( p_intf, mdate() + 30000000 );
 
         p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
         if( p_input )