Commit 26a1e9d2 authored by Laurent Aimar's avatar Laurent Aimar

Moved input_EsOutIsBuffering to es_out_Control.

parent 719d408b
......@@ -495,10 +495,6 @@ bool input_EsOutDecodersIsEmpty( es_out_t *out )
return true;
}
bool input_EsOutIsBuffering( es_out_t *out )
{
return out->p_sys->b_buffering;
}
void input_EsOutFrameNext( es_out_t *out )
{
es_out_sys_t *p_sys = out->p_sys;
......@@ -2309,6 +2305,11 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
return es_out_Control( out, i_new_query, p_es );
}
case ES_OUT_GET_BUFFERING:
pb = (bool *)va_arg( args, bool* );
*pb = p_sys->b_buffering;
return VLC_SUCCESS;
default:
msg_Err( p_sys->p_input, "unknown query in es_out_Control" );
return VLC_EGENERIC;
......
......@@ -40,6 +40,9 @@ enum es_out_query_private_e
ES_OUT_SET_ES_BY_ID,
ES_OUT_RESTART_ES_BY_ID,
ES_OUT_SET_ES_DEFAULT_BY_ID,
/* Get buffering state */
ES_OUT_GET_BUFFERING, /* arg1=bool* res=cannot fail */
};
static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
......@@ -50,6 +53,15 @@ static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
assert( !i_ret );
return i_wu;
}
static inline bool es_out_GetBuffering( es_out_t *p_out )
{
bool b;
int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b );
assert( !i_ret );
return b;
}
es_out_t *input_EsOutNew( input_thread_t *, int i_rate );
......@@ -59,7 +71,6 @@ void input_EsOutChangeRate( es_out_t *, int );
void input_EsOutChangePause( es_out_t *, bool b_paused, mtime_t i_date );
void input_EsOutChangePosition( es_out_t * );
bool input_EsOutDecodersIsEmpty( es_out_t * );
bool input_EsOutIsBuffering( es_out_t * );
void input_EsOutFrameNext( es_out_t * );
void input_EsOutLock( es_out_t * );
......
......@@ -745,10 +745,8 @@ static void MainLoop( input_thread_t *p_input )
/* FIXME if p_input->i_state == PAUSE_S the access/access_demux
* is paused -> this may cause problem with some of them
* The same problem can be seen when seeking while paused */
input_EsOutLock( p_input->p->p_es_out );
b_paused = p_input->i_state == PAUSE_S &&
!input_EsOutIsBuffering( p_input->p->p_es_out );
input_EsOutUnlock( p_input->p->p_es_out );
!es_out_GetBuffering( p_input->p->p_es_out );
if( !b_paused )
{
......
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