[vlc-commits] dbus: Remove warnings and dead code

Mirsal Ennaime git at videolan.org
Mon May 16 23:40:18 CEST 2011


vlc | branch: master | Mirsal Ennaime <mirsal at mirsal.fr> | Mon May 16 23:39:32 2011 +0200| [4423fd4bb4b6242fa5ea3ee21206757ee9f2927c] | committer: Mirsal Ennaime

dbus: Remove warnings and dead code

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

 modules/control/dbus/dbus.c        |   43 ++++-------------------------------
 modules/control/dbus/dbus_player.c |   16 +++++++++++--
 2 files changed, 18 insertions(+), 41 deletions(-)

diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index 2cbb317..b5ffe53 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -95,7 +95,6 @@ static int  Open    ( vlc_object_t * );
 static void Close   ( vlc_object_t * );
 static void Run     ( intf_thread_t * );
 
-static int StateChange( intf_thread_t * );
 static int TrackChange( intf_thread_t * );
 static int AllCallback( vlc_object_t*, const char*, vlc_value_t, vlc_value_t, void* );
 
@@ -780,7 +779,7 @@ static void DispatchDBusMessages( intf_thread_t *p_intf )
 static DBusHandlerResult
 MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this )
 {
-    char *psz_target_interface;
+    const char *psz_target_interface;
     const char *psz_interface = dbus_message_get_interface( p_from );
     const char *psz_method    = dbus_message_get_member( p_from );
 
@@ -968,7 +967,7 @@ static int InputIntfEventCallback( intf_thread_t   *p_intf,
     dbus_int32_t i_state = PLAYBACK_STATE_INVALID;
     assert(!p_info->signal);
     mtime_t i_now = mdate(), i_pos, i_projected_pos, i_interval;
-    float f_current_rate, f_computed_rate;
+    float f_current_rate;
 
     switch( i_event )
     {
@@ -1075,8 +1074,9 @@ static int AllCallback( vlc_object_t *p_this, const char *psz_var,
 
     else if( !strcmp( "intf-event", psz_var ) )
     {
-        int i_res;
-        i_res = InputIntfEventCallback( p_intf, p_this, newval.i_int, info );
+        int i_res = InputIntfEventCallback( p_intf,
+                                            (input_thread_t*) p_this,
+                                            newval.i_int, info );
         if( VLC_SUCCESS != i_res )
         {
             vlc_mutex_unlock( &p_intf->p_sys->lock );
@@ -1109,39 +1109,6 @@ static int AllCallback( vlc_object_t *p_this, const char *psz_var,
 }
 
 /*****************************************************************************
- * StateChange: callback on input "state"
- *****************************************************************************/
-static int StateChange( intf_thread_t *p_intf )
-{
-    intf_sys_t          *p_sys      = p_intf->p_sys;
-    playlist_t          *p_playlist = p_sys->p_playlist;
-    input_thread_t      *p_input;
-    input_item_t        *p_item;
-
-    if( p_intf->p_sys->b_dead )
-        return VLC_SUCCESS;
-
-    if( !p_sys->b_meta_read && p_sys->i_playing_state == 0)
-    {
-        p_input = playlist_CurrentInput( p_playlist );
-        if( p_input )
-        {
-            p_item = input_GetItem( p_input );
-            if( p_item )
-            {
-                p_sys->b_meta_read = true;
-                TrackChangedEmit( p_intf, p_item );
-            }
-            vlc_object_release( p_input );
-        }
-    }
-
-    PlayerStatusChangedEmit( p_intf );
-
-    return VLC_SUCCESS;
-}
-
-/*****************************************************************************
  * TrackChange: callback on playlist "item-current"
  *****************************************************************************/
 static int TrackChange( intf_thread_t *p_intf )
diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index dea7851..87a99b6 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -38,7 +38,7 @@
 #include "dbus_player.h"
 #include "dbus_common.h"
 
-static int MarshalStatus ( intf_thread_t *, DBusMessageIter * );
+static void MarshalLoopStatus ( intf_thread_t *, DBusMessageIter * );
 
 DBUS_METHOD( Position )
 { /* returns position in microseconds */
@@ -371,6 +371,8 @@ DBUS_METHOD( CanPause )
 
 DBUS_METHOD( CanControl )
 {
+    VLC_UNUSED( p_this );
+
     REPLY_INIT;
     OUT_ARGUMENTS;
 
@@ -464,7 +466,8 @@ static void
 MarshalPlaybackStatus( intf_thread_t *p_intf, DBusMessageIter *container )
 {
     input_thread_t *p_input;
-    char *psz_playback_status;
+    const char *psz_playback_status;
+
     if( ( p_input = playlist_CurrentInput( p_intf->p_sys->p_playlist ) ) )
     {
         switch( var_GetInteger( p_input, "state" ) )
@@ -564,6 +567,8 @@ DBUS_METHOD( RateSet )
 
 DBUS_METHOD( MinimumRate )
 {
+    VLC_UNUSED( p_this );
+
     REPLY_INIT;
     OUT_ARGUMENTS;
 
@@ -584,6 +589,8 @@ DBUS_METHOD( MinimumRate )
 
 DBUS_METHOD( MaximumRate )
 {
+    VLC_UNUSED( p_this );
+
     REPLY_INIT;
     OUT_ARGUMENTS;
 
@@ -605,11 +612,14 @@ DBUS_METHOD( MaximumRate )
 static void
 MarshalLoopStatus( intf_thread_t *p_intf, DBusMessageIter *container )
 {
-    char *psz_loop_status;
+    const char *psz_loop_status;
+
     if( var_GetBool( p_intf->p_sys->p_playlist, "repeat" ) )
         psz_loop_status = LOOP_STATUS_TRACK;
+
     else if( var_GetBool( p_intf->p_sys->p_playlist, "loop" ) )
         psz_loop_status = LOOP_STATUS_PLAYLIST;
+
     else
         psz_loop_status = LOOP_STATUS_NONE;
 



More information about the vlc-commits mailing list