]> git.sesse.net Git - vlc/commitdiff
Use pl_Release an factorise two lines.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 21 Jul 2008 16:25:24 +0000 (18:25 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 21 Jul 2008 16:36:50 +0000 (18:36 +0200)
modules/misc/lua/libs/input.c
modules/misc/lua/libs/playlist.c
modules/misc/lua/libs/sd.c
modules/misc/notify/growl.m
modules/misc/notify/growl_udp.c
modules/misc/notify/xosd.c

index 650b99ae9888b9b5127425ee4595000339520e47..7eab977ea7464995d8c87c561e10df4e961d9a21 100644 (file)
@@ -51,7 +51,7 @@ input_thread_t * vlclua_get_input_internal( lua_State *L )
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     input_thread_t *p_input = p_playlist->p_input;
     if( p_input ) vlc_object_yield( p_input );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return p_input;
 }
 
index 0eac614724c558391fa3803b4521bb39cafe0544..04cdfc459198b3ed77e2939ec3c5ff60effa431e 100644 (file)
@@ -58,7 +58,7 @@ static int vlclua_playlist_prev( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Prev( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -66,7 +66,7 @@ static int vlclua_playlist_next( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Next( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -75,7 +75,7 @@ static int vlclua_playlist_skip( lua_State * L )
     int i_skip = luaL_checkint( L, 1 );
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Skip( p_playlist, i_skip );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -83,7 +83,7 @@ static int vlclua_playlist_play( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Play( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -91,7 +91,7 @@ static int vlclua_playlist_pause( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Pause( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -99,7 +99,7 @@ static int vlclua_playlist_stop( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Stop( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -108,7 +108,7 @@ static int vlclua_playlist_clear( lua_State * L )
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     playlist_Stop( p_playlist ); /* Isn't this already implied by Clear? */
     playlist_Clear( p_playlist, pl_Unlocked );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 0;
 }
 
@@ -116,7 +116,7 @@ static int vlclua_playlist_repeat( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     int i_ret = vlclua_var_toggle_or_set( L, p_playlist, "repeat" );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return i_ret;
 }
 
@@ -124,7 +124,7 @@ static int vlclua_playlist_loop( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     int i_ret = vlclua_var_toggle_or_set( L, p_playlist, "loop" );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return i_ret;
 }
 
@@ -132,7 +132,7 @@ static int vlclua_playlist_random( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     int i_ret = vlclua_var_toggle_or_set( L, p_playlist, "random" );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return i_ret;
 }
 
@@ -144,7 +144,7 @@ static int vlclua_playlist_goto( lua_State * L )
                                   true, NULL,
                                   playlist_ItemGetById( p_playlist, i_id,
                                                         true ) );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return vlclua_push_ret( L, i_ret );
 }
 
@@ -155,7 +155,7 @@ static int vlclua_playlist_add( lua_State *L )
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     i_count = vlclua_playlist_add_internal( p_this, L, p_playlist,
                                             NULL, true );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     lua_pushinteger( L, i_count );
     return 1;
 }
@@ -167,7 +167,7 @@ static int vlclua_playlist_enqueue( lua_State *L )
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     i_count = vlclua_playlist_add_internal( p_this, L, p_playlist,
                                             NULL, false );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     lua_pushinteger( L, i_count );
     return 1;
 }
@@ -235,7 +235,7 @@ static int vlclua_playlist_get( lua_State *L )
         p_item = playlist_ItemGetById( p_playlist, i_id, true );
         if( !p_item )
         {
-            vlc_object_release( p_playlist );
+            pl_Release( p_playlist );
             return 0; /* Should we return an error instead? */
         }
     }
@@ -268,7 +268,7 @@ static int vlclua_playlist_get( lua_State *L )
             }
             if( !p_item )
             {
-                vlc_object_release( p_playlist );
+                pl_Release( p_playlist );
                 return 0; /* Should we return an error instead? */
             }
         }
@@ -279,7 +279,7 @@ static int vlclua_playlist_get( lua_State *L )
                             : p_playlist->p_root_onelevel;
     }
     push_playlist_item( L, p_item );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 1;
 }
 
@@ -292,7 +292,7 @@ static int vlclua_playlist_search( lua_State *L )
                                          : p_playlist->p_root_onelevel;
     playlist_LiveSearchUpdate( p_playlist, p_item, psz_string );
     push_playlist_item( L, p_item );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 1;
 }
 
@@ -300,7 +300,7 @@ static int vlclua_playlist_current( lua_State *L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     lua_pushinteger( L, var_GetInteger( p_playlist, "playlist-current" ) );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 1;
 }
 
@@ -343,7 +343,7 @@ static int vlclua_playlist_sort( lua_State *L )
                                          : p_playlist->p_local_onelevel;
     int i_ret = playlist_RecursiveNodeSort( p_playlist, p_root, i_mode,
                                             i_type );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return vlclua_push_ret( L, i_ret );
 }
 
@@ -385,7 +385,7 @@ static int vlclua_playlist_status( lua_State *L )
     {
         lua_pushstring( L, "stopped" );
     }
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 1;
 }
 
index 205fe92e8691796f39faf2fc3d2a390e07003277..100d9e91d32e1e3e075b8736021104eca6a25b45 100644 (file)
@@ -76,7 +76,7 @@ static int vlclua_sd_add( lua_State *L )
     const char *psz_sd = luaL_checkstring( L, 1 );
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     int i_ret = playlist_ServicesDiscoveryAdd( p_playlist, psz_sd );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return vlclua_push_ret( L, i_ret );
 }
 
@@ -85,7 +85,7 @@ static int vlclua_sd_remove( lua_State *L )
     const char *psz_sd = luaL_checkstring( L, 1 );
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     int i_ret = playlist_ServicesDiscoveryRemove( p_playlist, psz_sd );
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return vlclua_push_ret( L, i_ret );
 }
 
@@ -94,7 +94,7 @@ static int vlclua_sd_is_loaded( lua_State *L )
     const char *psz_sd = luaL_checkstring( L, 1 );
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
     lua_pushboolean( L, playlist_IsServicesDiscoveryLoaded( p_playlist, psz_sd ));
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
     return 1;
 }
 
index 80764c99eda680ddf3dbe3e5a22c9d8277e0e672..f506e966e2dbbe96ad9e127b190c00fa2733380e 100644 (file)
@@ -162,7 +162,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     playlist_t *p_playlist = pl_Yield( p_this );
 
     p_input = p_playlist->p_input;
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
 
     if( !p_input ) return VLC_SUCCESS;
     vlc_object_yield( p_input );
index 62b25641a3ceb0f335fd464003caae2db47fb33e..e1d25805e942c063a8ee88659d4bf04a44afe44f 100644 (file)
@@ -124,7 +124,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     playlist_t *p_playlist = pl_Yield( p_this );
 
     p_input = p_playlist->p_input;
-    vlc_object_release( p_playlist );
+    pl_Release( p_playlist );
 
     if( !p_input ) return VLC_SUCCESS;
     vlc_object_yield( p_input );
index 9ba256a80fd021a7f9e041f19cb3b3cf86efb0b8..4c766bfe85acf99c856fccb7e65181088e9546f8 100644 (file)
@@ -220,7 +220,7 @@ static void Run( intf_thread_t *p_intf )
 
             if( playlist_IsEmpty( p_playlist ) )
             {
-                vlc_object_release( p_playlist );
+                pl_Release( p_playlist );
                 continue;
             }
             free( psz_display );
@@ -228,24 +228,21 @@ static void Run( intf_thread_t *p_intf )
             if( p_playlist->status.i_status == PLAYLIST_STOPPED )
             {
                 psz_display = strdup(_("Stop"));
-                vlc_object_release( p_playlist );
+                pl_Release( p_playlist );
             }
             else if( p_playlist->status.i_status == PLAYLIST_PAUSED )
             {
                 psz_display = strdup(_("Pause"));
-                vlc_object_release( p_playlist );
+                pl_Release( p_playlist );
             }
             else
             {
                 p_item = p_playlist->status.p_item;
                 p_input = p_item->p_input;
+
+                pl_Release( p_playlist );
                 if( !p_item )
-                {
-                    vlc_object_release( p_playlist );
                     continue;
-                }
-
-                vlc_object_release( p_playlist );
 
                 mtime_t i_duration = input_item_GetDuration( p_input );
                 if( i_duration != -1 )