[vlc-devel] commit: Fix #1581 - Really fix #986 - rc : do not read stdin when we can't ( Rafaël Carré )

git version control git at videolan.org
Mon May 12 13:45:05 CEST 2008


vlc | branch: 0.8.6-bugfix | Rafaël Carré <funman at videolan.org> | Mon May 12 13:46:01 2008 +0200| [232337c3a3aba420a779aeb61b1dfbff267b6e6f]

Fix #1581 - Really fix #986 - rc : do not read stdin when we can't

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

 modules/control/rc.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index 3ad9247..15f1913 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -141,8 +141,11 @@ void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
 
     if( p_intf->p_sys->i_socket == -1 )
     {
-        utf8_vfprintf( stdout, psz_fmt, args );
-        printf( "\r\n" );
+        if( !p_intf->p_sys->pi_socket_listen )
+        {
+            utf8_vfprintf( stdout, psz_fmt, args );
+            printf( "\r\n" );
+        }
     }
     else
     {
@@ -2297,6 +2300,13 @@ vlc_bool_t ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
     }
 #endif
 
+    if( p_intf->p_sys->i_socket == -1 && p_intf->p_sys->pi_socket_listen )
+    {
+        /* Do not try to read stdin if we are listening on a socket */
+        msleep( INTF_IDLE_SLEEP );
+        return VLC_FALSE;
+    }
+
     while( !p_intf->b_die && *pi_size < MAX_LINE_LENGTH &&
            (i_read = net_ReadNonBlock( p_intf, p_intf->p_sys->i_socket == -1 ?
                        0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket, NULL,




More information about the vlc-devel mailing list