Commit 5b880a59 authored by Damien Fouilleul's avatar Damien Fouilleul

- input: added intermediate state info opening & buffering

parent 0a9262fd
...@@ -522,6 +522,14 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer, ...@@ -522,6 +522,14 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
{ {
sprintf( state, "playing" ); sprintf( state, "playing" );
} }
else if( val.i_int == OPENING_S )
{
sprintf( state, "opening/connecting" );
}
else if( val.i_int == BUFFERING_S )
{
sprintf( state, "buffering" );
}
else if( val.i_int == PAUSE_S ) else if( val.i_int == PAUSE_S )
{ {
sprintf( state, "paused" ); sprintf( state, "paused" );
......
...@@ -313,6 +313,8 @@ MediaControlView::SetStatus(int status, int rate) ...@@ -313,6 +313,8 @@ MediaControlView::SetStatus(int status, int rate)
switch( status ) switch( status )
{ {
case PLAYING_S: case PLAYING_S:
case OPENNING_S:
case BUFFERING_S:
fPlayPause->SetPlaying(); fPlayPause->SetPlaying();
break; break;
case PAUSE_S: case PAUSE_S:
......
...@@ -1213,6 +1213,14 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh ) ...@@ -1213,6 +1213,14 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
{ {
mvnprintw( y++, 0, COLS, " State : Playing" ); mvnprintw( y++, 0, COLS, " State : Playing" );
} }
else if( val.i_int == OPENNING_S )
{
mvnprintw( y++, 0, COLS, " State : Openning/Connecting" );
}
else if( val.i_int == BUFFERING_S )
{
mvnprintw( y++, 0, COLS, " State : Buffering" );
}
else if( val.i_int == PAUSE_S ) else if( val.i_int == PAUSE_S )
{ {
mvnprintw( y++, 0, COLS, " State : Paused" ); mvnprintw( y++, 0, COLS, " State : Paused" );
......
...@@ -1048,10 +1048,7 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick ) ...@@ -1048,10 +1048,7 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
} }
/* initialization is complete */ /* initialization is complete */
p_input->i_state = PLAYING_S; input_ChangeState(p_input, PLAYING_S);
val.i_int = PLAYING_S;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -1091,16 +1088,12 @@ static void Error( input_thread_t *p_input ) ...@@ -1091,16 +1088,12 @@ static void Error( input_thread_t *p_input )
*****************************************************************************/ *****************************************************************************/
static void End( input_thread_t * p_input ) static void End( input_thread_t * p_input )
{ {
vlc_value_t val;
int i; int i;
msg_Dbg( p_input, "closing input" ); msg_Dbg( p_input, "closing input" );
/* We are at the end */ /* We are at the end */
p_input->i_state = END_S; input_ChangeState(p_input, END_S);
val.i_int = END_S;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
/* Clean control variables */ /* Clean control variables */
input_ControlVarClean( p_input ); input_ControlVarClean( p_input );
...@@ -1983,6 +1976,8 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -1983,6 +1976,8 @@ static int InputSourceInit( input_thread_t *p_input,
{ {
int64_t i_pts_delay; int64_t i_pts_delay;
input_ChangeState( p_input, OPENING_S);
/* Now try a real access */ /* Now try a real access */
in->p_access = access2_New( p_input, psz_access, psz_demux, psz_path, in->p_access = access2_New( p_input, psz_access, psz_demux, psz_path,
b_quick ); b_quick );
...@@ -2079,6 +2074,8 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2079,6 +2074,8 @@ static int InputSourceInit( input_thread_t *p_input,
var_Set( p_input, "seekable", val ); var_Set( p_input, "seekable", val );
} }
input_ChangeState( p_input, BUFFERING_S);
/* Create the stream_t */ /* Create the stream_t */
in->p_stream = stream_AccessNew( in->p_access, b_quick ); in->p_stream = stream_AccessNew( in->p_access, b_quick );
if( in->p_stream == NULL ) if( in->p_stream == NULL )
......
...@@ -156,4 +156,11 @@ int subtitles_Filter( const char *); ...@@ -156,4 +156,11 @@ int subtitles_Filter( const char *);
void MRLSplit( vlc_object_t *, char *, char **, char **, char ** ); void MRLSplit( vlc_object_t *, char *, char **, char **, char ** );
static inline void input_ChangeState( input_thread_t *p_input, int state )
{
vlc_value_t val;
val.i_int = state;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
}
#endif #endif
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