[vlc-devel] commit: Cleanup playlist status. (Antoine Cellerier )

git version control git at videolan.org
Mon Dec 21 21:56:12 CET 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sun Dec 20 15:44:01 2009 +0100| [c7b0875374876a36c40db3e295bba2d6876fb589] | committer: Antoine Cellerier 

Cleanup playlist status.

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

 modules/misc/lua/libs/playlist.c |   49 +++++++++++--------------------------
 share/lua/intf/rc.lua            |    7 ++---
 2 files changed, 18 insertions(+), 38 deletions(-)

diff --git a/modules/misc/lua/libs/playlist.c b/modules/misc/lua/libs/playlist.c
index 3ded0bc..240b521 100644
--- a/modules/misc/lua/libs/playlist.c
+++ b/modules/misc/lua/libs/playlist.c
@@ -378,45 +378,26 @@ static int vlclua_playlist_sort( lua_State *L )
     return vlclua_push_ret( L, i_ret );
 }
 
-/* FIXME: split this in 3 different functions? */
 static int vlclua_playlist_status( lua_State *L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
-    /*
-    int i_count = 0;
-    lua_settop( L, 0 );*/
-    input_thread_t * p_input = playlist_CurrentInput( p_playlist );
-    if( p_input )
-    {
-        /*char *psz_uri =
-            input_item_GetURI( input_GetItem( p_playlist->p_input ) );
-        lua_pushstring( L, psz_uri );
-        free( psz_uri );
-        lua_pushnumber( L, config_GetInt( p_intf, "volume" ) );*/
-        PL_LOCK;
-        switch( playlist_Status( p_playlist ) )
-        {
-            case PLAYLIST_STOPPED:
-                lua_pushstring( L, "stopped" );
-                break;
-            case PLAYLIST_RUNNING:
-                lua_pushstring( L, "playing" );
-                break;
-            case PLAYLIST_PAUSED:
-                lua_pushstring( L, "paused" );
-                break;
-            default:
-                lua_pushstring( L, "unknown" );
-                break;
-        }
-        PL_UNLOCK;
-        /*i_count += 3;*/
-        vlc_object_release( p_input );
-    }
-    else
+    PL_LOCK;
+    switch( playlist_Status( p_playlist ) )
     {
-        lua_pushstring( L, "stopped" );
+        case PLAYLIST_STOPPED:
+            lua_pushstring( L, "stopped" );
+            break;
+        case PLAYLIST_RUNNING:
+            lua_pushstring( L, "playing" );
+            break;
+        case PLAYLIST_PAUSED:
+            lua_pushstring( L, "paused" );
+            break;
+        default:
+            lua_pushstring( L, "unknown" );
+            break;
     }
+    PL_UNLOCK;
     vlclua_release_playlist_internal( p_playlist );
     return 1;
 }
diff --git a/share/lua/intf/rc.lua b/share/lua/intf/rc.lua
index d4c815a..2348c4e 100644
--- a/share/lua/intf/rc.lua
+++ b/share/lua/intf/rc.lua
@@ -350,10 +350,9 @@ function stats(name,client)
 end
 
 function playlist_status(name,client)
-    local a,b,c = vlc.playlist.status()
-    client:append( "( new input: " .. tostring(a) .. " )" )
-    client:append( "( audio volume: " .. tostring(b) .. " )")
-    client:append( "( state " .. tostring(c) .. " )")
+    client:append( "( new input: " .. "FIXME" .. " )" )
+    client:append( "( audio volume: " .. tostring(vlc.volume.get()) .. " )")
+    client:append( "( state " .. vlc.playlist.status() .. " )")
 end
 
 function is_playing(name,client)




More information about the vlc-devel mailing list