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