[vlc-devel] commit: Revert "Hide es out timeshift delay from time display." ( Laurent Aimar )

git version control git at videolan.org
Sat Nov 29 10:53:16 CET 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Nov 28 21:55:06 2008 +0100| [1f8343b87c62f77f2a95ce29ceed3f416b2399e4] | committer: Laurent Aimar 

Revert "Hide es out timeshift delay from time display."

This reverts commit d30180d8ec7de8776611de5c2f0b0e1587bf0ad4.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f8343b87c62f77f2a95ce29ceed3f416b2399e4
---

 src/input/es_out.c           |    7 +------
 src/input/es_out.h           |   11 ++++-------
 src/input/es_out_timeshift.c |   31 ++++---------------------------
 src/input/input.c            |   29 +----------------------------
 src/input/input_internal.h   |    5 +----
 5 files changed, 11 insertions(+), 72 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 125370a..1cb3db7 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2249,14 +2249,9 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         }
 
         case ES_OUT_GET_BUFFERING:
-        {
-#warning "TODO ES_OUT_GET_BUFFERING"
-            bool *pb = (bool *)va_arg( args, bool* );
-            mtime_t *pi_delay = (mtime_t*)va_arg( args, mtime_t* );
+            pb = (bool *)va_arg( args, bool* );
             *pb = p_sys->b_buffering;
-            *pi_delay = 0;
             return VLC_SUCCESS;
-        }
 
         case ES_OUT_GET_EMPTY:
             pb = (bool *)va_arg( args, bool* );
diff --git a/src/input/es_out.h b/src/input/es_out.h
index 5837daa..580e923 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -49,7 +49,7 @@ enum es_out_query_private_e
     ES_OUT_SET_ES_DEFAULT_BY_ID,
 
     /* Get buffering state */
-    ES_OUT_GET_BUFFERING,                           /* arg1=bool*, arg2=mtime_t*                                res=cannot fail */
+    ES_OUT_GET_BUFFERING,                           /* arg1=bool*               res=cannot fail */
 
     /* Check if es_out has still data to play */
     ES_OUT_GET_EMPTY,                               /* arg1=bool*               res=cannot fail */
@@ -81,15 +81,12 @@ 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, mtime_t *pi_delay )
+static inline bool es_out_GetBuffering( es_out_t *p_out )
 {
     bool b;
-    mtime_t i_delay;
-    int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b, &i_delay );
-    assert( !i_ret );
+    int i_ret = es_out_Control( p_out, ES_OUT_GET_BUFFERING, &b );
 
-    if( pi_delay )
-        *pi_delay = i_delay;
+    assert( !i_ret );
     return b;
 }
 static inline bool es_out_GetEmpty( es_out_t *p_out )
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 3b257b7..e95a5a4 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -239,7 +239,6 @@ static bool         TsHasCmd( ts_thread_t * );
 static bool         TsIsUnused( ts_thread_t * );
 static int          TsChangePause( ts_thread_t *, bool b_source_paused, bool b_paused, mtime_t i_date );
 static int          TsChangeRate( ts_thread_t *, int i_src_rate, int i_rate );
-static mtime_t      TsGetDelay( ts_thread_t * );
 
 static void         *TsRun( vlc_object_t * );
 
@@ -461,22 +460,14 @@ static int ControlLockedGetWakeup( es_out_t *p_out, mtime_t *pi_wakeup )
 
     return VLC_SUCCESS;
 }
-static int ControlLockedGetBuffering( es_out_t *p_out, bool *pb_buffering, mtime_t *pi_delay )
+static int ControlLockedGetBuffering( es_out_t *p_out, bool *pb_buffering )
 {
     es_out_sys_t *p_sys = p_out->p_sys;
 
     if( p_sys->b_delayed )
-    {
-        mtime_t i_delay;
-        es_out_GetBuffering( p_sys->p_out, &i_delay );
-
         *pb_buffering = true;
-        *pi_delay = i_delay + TsGetDelay( p_sys->p_thread );
-    }
     else
-    {
-        *pb_buffering = es_out_GetBuffering( p_sys->p_out, pi_delay );
-    }
+        *pb_buffering = es_out_GetBuffering( p_sys->p_out );
 
     return VLC_SUCCESS;
 }
@@ -644,8 +635,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
     case ES_OUT_GET_BUFFERING:
     {
         bool *pb_buffering = (bool *)va_arg( args, bool* );
-        mtime_t *pi_delay = (mtime_t*)va_arg( args, mtime_t* );
-        return ControlLockedGetBuffering( p_out, pb_buffering, pi_delay );
+        return ControlLockedGetBuffering( p_out, pb_buffering );
     }
     case ES_OUT_SET_PAUSE_STATE:
     {
@@ -911,19 +901,6 @@ static int TsChangeRate( ts_thread_t *p_ts, int i_src_rate, int i_rate )
 
     return i_ret;
 }
-static mtime_t TsGetDelay( ts_thread_t *p_ts )
-{
-    mtime_t i_delay;
-
-    vlc_mutex_lock( &p_ts->lock );
-    i_delay = p_ts->i_cmd_delay + p_ts->i_rate_delay + p_ts->i_buffering_delay;
-    if( p_ts->b_paused )
-        i_delay += mdate() - p_ts->i_pause_date;
-    vlc_mutex_unlock( &p_ts->lock );
-
-    return i_delay;
-}
-
 
 static void *TsRun( vlc_object_t *p_thread )
 {
@@ -943,7 +920,7 @@ static void *TsRun( vlc_object_t *p_thread )
         for( ;; )
         {
             const int canc = vlc_savecancel();
-            b_buffering = es_out_GetBuffering( p_ts->p_out, NULL );
+            b_buffering = es_out_GetBuffering( p_ts->p_out );
 
             if( ( !p_ts->b_paused || b_buffering ) && !TsPopCmdLocked( p_ts, &cmd, false ) )
             {
diff --git a/src/input/input.c b/src/input/input.c
index a31f7ee..1570f88 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -198,7 +198,6 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
     p_input->p->input.b_rescale_ts = true;
     p_input->p->input.b_eof = false;
     p_input->p->input.i_cr_average = 0;
-    memset( &p_input->p->input_last_times, 0, sizeof(p_input->p->input_last_times) );
 
     vlc_mutex_lock( &p_item->lock );
 
@@ -646,9 +645,6 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, mtime_t *p
 static void MainLoopInterface( input_thread_t *p_input )
 {
     input_event_times_t ev;
-    mtime_t i_es_out_delay;
-
-    es_out_GetBuffering( p_input->p->p_es_out, &i_es_out_delay );
 
     ev.f_position = 0.0;
     ev.i_time = 0;
@@ -667,29 +663,6 @@ static void MainLoopInterface( input_thread_t *p_input )
                        DEMUX_GET_LENGTH, &ev.i_length ) )
         ev.i_length = 0;
 
-    if( ev.i_time > 0 )
-    {
-        ev.i_time -= i_es_out_delay;
-        if( ev.i_time < 0 )
-            ev.i_time = 0;
-    }
-    if( ev.i_length > 0 )
-    {
-        ev.f_position -= (double)i_es_out_delay / ev.i_length;
-    }
-
-    if( p_input->i_state == PAUSE_S )
-    {
-        input_event_times_t old = p_input->p->input_last_times;
-
-        /* XXX We have a jitter because of PCR frequency/get time precision.
-         * Hides it */
-        if( llabs(ev.i_time - old.i_time) < CLOCK_FREQ )
-            ev.i_time = old.i_time;
-    }
-
-    p_input->p->input_last_times = ev;
-
     input_SendEventTimes( p_input, &ev );
 }
 
@@ -739,7 +712,7 @@ static void MainLoop( input_thread_t *p_input )
          * is paused -> this may cause problem with some of them
          * The same problem can be seen when seeking while paused */
         b_paused = p_input->i_state == PAUSE_S &&
-                   !es_out_GetBuffering( p_input->p->p_es_out, NULL );
+                   !es_out_GetBuffering( p_input->p->p_es_out );
 
         if( !b_paused )
         {
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index dce67ab..7165bd9 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -33,7 +33,6 @@
 #include <vlc_input.h>
 #include <libvlc.h>
 #include "input_interface.h"
-#include "event.h"
 
 /*****************************************************************************
  *  Private input fields
@@ -119,9 +118,7 @@ struct input_thread_private_t
     bool            b_out_pace_control; /*     idem ? */
 
     /* Main input properties */
-    input_source_t      input;
-    input_event_times_t input_last_times;
-
+    input_source_t input;
     /* Slave demuxers (subs, and others) */
     int            i_slave;
     input_source_t **slave;




More information about the vlc-devel mailing list