[vlc-devel] commit: Moved input_EsOutIsBuffering to es_out_Control. (Laurent Aimar )
git version control
git at videolan.org
Tue Nov 4 23:56:12 CET 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Nov 2 18:30:17 2008 +0100| [26a1e9d2458188f6330181650665303f629d0e37] | committer: Laurent Aimar
Moved input_EsOutIsBuffering to es_out_Control.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=26a1e9d2458188f6330181650665303f629d0e37
---
src/input/es_out.c | 9 +++++----
src/input/es_out.h | 15 +++++++++++++--
src/input/input.c | 4 +---
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index e15f314..ea9124d 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -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;
diff --git a/src/input/es_out.h b/src/input/es_out.h
index 1cca7f7..71bda21 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -34,12 +34,15 @@
enum es_out_query_private_e
{
/* Get date to wait before demuxing more data */
- ES_OUT_GET_WAKE_UP = ES_OUT_PRIVATE_START, /* arg1=mtime_t* res=cannot fail */
+ ES_OUT_GET_WAKE_UP = ES_OUT_PRIVATE_START, /* arg1=mtime_t* res=cannot fail */
/* Wrapper for some ES command to work with id */
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 * );
diff --git a/src/input/input.c b/src/input/input.c
index 06fe623..1813ff1 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -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 )
{
More information about the vlc-devel
mailing list