[vlc-commits] cli: don't print state from two places

Rémi Denis-Courmont git at videolan.org
Sat Oct 17 20:35:45 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 17 12:31:17 2020 +0300| [83e212a86797bc2d0bd74b8645f2f966e3323a0f] | committer: Rémi Denis-Courmont

cli: don't print state from two places

We already have the player state callback.

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

 modules/control/cli/cli.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c
index 63549d7e79..f6a470aaf5 100644
--- a/modules/control/cli/cli.c
+++ b/modules/control/cli/cli.c
@@ -520,40 +520,6 @@ static void *Run( void *data )
             }
         }
 
-        if( !vlc_player_IsStarted( player ) )
-        {
-            if (item)
-                item = NULL;
-
-            p_sys->last_state = VLC_PLAYER_STATE_STOPPED;
-            msg_rc( STATUS_CHANGE "( stop state: 0 )" );
-        }
-
-        if( item != NULL )
-        {
-            enum vlc_player_state state = vlc_player_GetState(player);
-
-            if (p_sys->last_state != state)
-            {
-                switch (state)
-                {
-                    case VLC_PLAYER_STATE_STOPPING:
-                    case VLC_PLAYER_STATE_STOPPED:
-                        msg_rc(STATUS_CHANGE "( stop state: 5 )");
-                        break;
-                    case VLC_PLAYER_STATE_PLAYING:
-                        msg_rc(STATUS_CHANGE "( play state: 3 )");
-                        break;
-                    case VLC_PLAYER_STATE_PAUSED:
-                        msg_rc(STATUS_CHANGE "( pause state: 4 )");
-                        break;
-                    default:
-                        break;
-                }
-                p_sys->last_state = state;
-            }
-        }
-
         if( item && b_showpos )
         {
             i_newpos = 100 * vlc_player_GetPosition( player );
@@ -746,7 +712,6 @@ static int Activate( vlc_object_t *p_this )
     p_sys->psz_unix_path = psz_unix_path;
 #endif
     vlc_mutex_init( &p_sys->status_lock );
-    p_sys->last_state = VLC_PLAYER_STATE_STOPPED;
     p_sys->b_input_buffering = false;
     p_sys->playlist = vlc_intf_GetMainPlaylist(p_intf);;
 



More information about the vlc-commits mailing list