Commit c37341f1 authored by Christophe Mutricy's avatar Christophe Mutricy

Avoid huge CPU comsumption when rc and --daemon are use at the same time

Patch by Bertrand Marquis aka bma on Launchpad (LP#104698)
Refs #986
parent df6829e6
......@@ -141,8 +141,12 @@ 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 (!config_GetInt( p_intf, "rc-fake-tty" ))
{
utf8_vfprintf( stdout, psz_fmt, args );
printf( "\r\n" );
}
}
else
{
......@@ -2297,6 +2301,12 @@ vlc_bool_t ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
}
#endif
if (p_intf->p_sys->i_socket == -1 && config_GetInt( p_intf, "rc-fake-tty" ))
{
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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment