Commit 821a5903 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Sanitize STATUS_CHANGE messages.

parent a0f5af02
...@@ -544,6 +544,8 @@ enum input_state_e ...@@ -544,6 +544,8 @@ enum input_state_e
ERROR_S ERROR_S
}; };
static const char *ppsz_input_state[] = { N_("Initializing"), N_("Opening"), N_("Buffer"), N_("Play"), N_("Pause"), N_("Stop"), N_("Error") }
/* "rate" default, min/max /* "rate" default, min/max
* A rate below 1000 plays the movie faster, * A rate below 1000 plays the movie faster,
* A rate above 1000 plays the movie slower. * A rate above 1000 plays the movie slower.
......
...@@ -548,21 +548,21 @@ static void Run( intf_thread_t *p_intf ) ...@@ -548,21 +548,21 @@ static void Run( intf_thread_t *p_intf )
(p_playlist->status.i_status == PLAYLIST_STOPPED) ) (p_playlist->status.i_status == PLAYLIST_STOPPED) )
{ {
p_intf->p_sys->i_last_state = PLAYLIST_STOPPED; p_intf->p_sys->i_last_state = PLAYLIST_STOPPED;
msg_rc( STATUS_CHANGE "( stop state: 0 )" ); msg_rc( STATUS_CHANGE "( stop state: 5 )" );
} }
else if( else if(
(p_intf->p_sys->i_last_state != p_playlist->status.i_status) && (p_intf->p_sys->i_last_state != p_playlist->status.i_status) &&
(p_playlist->status.i_status == PLAYLIST_RUNNING) ) (p_playlist->status.i_status == PLAYLIST_RUNNING) )
{ {
p_intf->p_sys->i_last_state = p_playlist->status.i_status; p_intf->p_sys->i_last_state = p_playlist->status.i_status;
msg_rc( STATUS_CHANGE "( play state: 1 )" ); msg_rc( STATUS_CHANGE "( play state: 3 )" );
} }
else if( else if(
(p_intf->p_sys->i_last_state != p_playlist->status.i_status) && (p_intf->p_sys->i_last_state != p_playlist->status.i_status) &&
(p_playlist->status.i_status == PLAYLIST_PAUSED) ) (p_playlist->status.i_status == PLAYLIST_PAUSED) )
{ {
p_intf->p_sys->i_last_state = p_playlist->status.i_status; p_intf->p_sys->i_last_state = p_playlist->status.i_status;
msg_rc( STATUS_CHANGE "( pause state: 2 )" ); msg_rc( STATUS_CHANGE "( pause state: 4 )" );
} }
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
} }
...@@ -999,7 +999,9 @@ static int StateChanged( vlc_object_t *p_this, char const *psz_cmd, ...@@ -999,7 +999,9 @@ static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,
default: default:
cmd[0] = '\0'; cmd[0] = '\0';
} /* var_GetInteger( p_input, "state" ) */ } /* var_GetInteger( p_input, "state" ) */
msg_rc( STATUS_CHANGE "( %s state: %d )", &cmd[0], newval.i_int ); msg_rc( STATUS_CHANGE "( %s state: %d ): %s",
&cmd[0], newval.i_int,
ppsz_input_state[ newval.i_int ] );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
vlc_object_release( p_input ); vlc_object_release( p_input );
...@@ -1479,16 +1481,16 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1479,16 +1481,16 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
switch( p_playlist->status.i_status ) switch( p_playlist->status.i_status )
{ {
case PLAYLIST_STOPPED: case PLAYLIST_STOPPED:
msg_rc( STATUS_CHANGE "( stop state: 0 )" ); msg_rc( STATUS_CHANGE "( stop state: 5 )" );
break; break;
case PLAYLIST_RUNNING: case PLAYLIST_RUNNING:
msg_rc( STATUS_CHANGE "( play state: 1 )" ); msg_rc( STATUS_CHANGE "( play state: 3 )" );
break; break;
case PLAYLIST_PAUSED: case PLAYLIST_PAUSED:
msg_rc( STATUS_CHANGE "( pause state: 2 )" ); msg_rc( STATUS_CHANGE "( pause state: 4 )" );
break; break;
default: default:
msg_rc( STATUS_CHANGE "( state unknown )" ); msg_rc( STATUS_CHANGE "( unknown state: -1 )" );
break; break;
} }
PL_UNLOCK; PL_UNLOCK;
...@@ -1715,7 +1717,9 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1715,7 +1717,9 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
} }
else if( !strcmp( psz_cmd, "snapshot" ) ) else if( !strcmp( psz_cmd, "snapshot" ) )
{ {
i_error = var_Set( p_vout, psz_variable, newval ); vlc_value_t val;
val.b_bool = VLC_TRUE;
i_error = var_Set( p_vout, psz_variable, val );
} }
else else
{ {
......
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