[vlc-devel] commit: One less vlc_object_find() (Christophe Mutricy )
git version control
git at videolan.org
Sun Jan 18 20:29:02 CET 2009
vlc | branch: master | Christophe Mutricy <xtophe at videolan.org> | Sun Jan 18 18:46:31 2009 +0000| [a87b2b98849866a78f5d0bf7273e1ceb3bb9a200] | committer: Christophe Mutricy
One less vlc_object_find()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a87b2b98849866a78f5d0bf7273e1ceb3bb9a200
---
modules/misc/inhibit.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/modules/misc/inhibit.c b/modules/misc/inhibit.c
index 4777493..b6a8151 100644
--- a/modules/misc/inhibit.c
+++ b/modules/misc/inhibit.c
@@ -38,6 +38,7 @@
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_interface.h>
+#include <vlc_playlist.h>
#include <dbus/dbus.h>
@@ -225,14 +226,16 @@ static int UnInhibit( intf_thread_t *p_intf )
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
+
+ playlist_t *p_playlist = pl_Hold( p_intf );
+ input_thread_t *p_input;
+
for( ;; )
{
- input_thread_t *p_input;
-
/* Check playing state every 30 seconds */
msleep( 30 * CLOCK_FREQ );
- p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
const int i_state = var_GetInteger( p_input, "state" );
@@ -258,4 +261,6 @@ static void Run( intf_thread_t *p_intf )
break;
}
}
+
+ pl_Release( p_intf );
}
More information about the vlc-devel
mailing list