[vlc-devel] [PATCH 2/2] oldrc: fix item leak

Thomas Guillem thomas at gllm.fr
Tue May 28 10:15:11 CEST 2019


There is no need to hold the item since the player is locked while it is
accessed.

Fixes #22328
---
 modules/control/oldrc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 4c0b9a0845..5ffb09691c 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -491,7 +491,7 @@ static void *Run( void *data )
         /* Manage the input part */
         if( item == NULL )
         {
-            item = vlc_player_HoldCurrentMedia(player);
+            item = vlc_player_GetCurrentMedia(player);
             /* New input has been registered */
             if( item )
             {
@@ -504,10 +504,7 @@ static void *Run( void *data )
         if( !vlc_player_IsStarted( player ) )
         {
             if (item)
-            {
-                input_item_Release( item );
                 item = NULL;
-            }
 
             p_sys->last_state = VLC_PLAYER_STATE_STOPPED;
             msg_rc( STATUS_CHANGE "( stop state: 0 )" );
-- 
2.20.1



More information about the vlc-devel mailing list