From 3b954882ebc4f0be1b5a3a03e7f160cf6963e479 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Sun, 22 Feb 2009 11:18:38 +0100 Subject: [PATCH] rc: factorisation --- modules/control/rc.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/modules/control/rc.c b/modules/control/rc.c index 119ba0bfcf..3f69001bb6 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -552,25 +552,23 @@ static void Run( intf_thread_t *p_intf ) { PL_LOCK; int status = playlist_Status( p_playlist ); - if( (p_intf->p_sys->i_last_state != status) && - (status == PLAYLIST_STOPPED) ) + if( p_intf->p_sys->i_last_state != status ) { - p_intf->p_sys->i_last_state = PLAYLIST_STOPPED; - msg_rc( STATUS_CHANGE "( stop state: 5 )" ); - } - else if( - (p_intf->p_sys->i_last_state != status) && - (status == PLAYLIST_RUNNING) ) - { - p_intf->p_sys->i_last_state = PLAYLIST_RUNNING; - msg_rc( STATUS_CHANGE "( play state: 3 )" ); - } - else if( - (p_intf->p_sys->i_last_state != status) && - (status == PLAYLIST_PAUSED) ) - { - p_intf->p_sys->i_last_state = PLAYLIST_PAUSED; - msg_rc( STATUS_CHANGE "( pause state: 4 )" ); + if( status == PLAYLIST_STOPPED ) + { + p_intf->p_sys->i_last_state = PLAYLIST_STOPPED; + msg_rc( STATUS_CHANGE "( stop state: 5 )" ); + } + else if( status == PLAYLIST_RUNNING ) + { + p_intf->p_sys->i_last_state = PLAYLIST_RUNNING; + msg_rc( STATUS_CHANGE "( play state: 3 )" ); + } + else if( status == PLAYLIST_PAUSED ) + { + p_intf->p_sys->i_last_state = PLAYLIST_PAUSED; + msg_rc( STATUS_CHANGE "( pause state: 4 )" ); + } } PL_UNLOCK; } -- 2.39.2