]> git.sesse.net Git - vlc/commitdiff
Revert "Hide es out timeshift delay from time display."
authorLaurent Aimar <fenrir@videolan.org>
Fri, 28 Nov 2008 20:55:06 +0000 (21:55 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 29 Nov 2008 09:46:20 +0000 (10:46 +0100)
This reverts commit d30180d8ec7de8776611de5c2f0b0e1587bf0ad4.

src/input/es_out.c
src/input/es_out.h
src/input/es_out_timeshift.c
src/input/input.c
src/input/input_internal.h

index 125370acfc0325919a0fef41c5d2d7feff635511..1cb3db71070baefaaaaf4a5a16dafd89211b8ef8 100644 (file)
@@ -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* );
index 5837daa9bd76e0501e329602e82dd983f29571c7..580e92331d48e994a1e5b5013364fc8abeb7c4ff 100644 (file)
@@ -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 )
index 3b257b7e259044c4f19dbef0a784ce683804feb1..e95a5a49500f4528a81562b419b2a4e7b0963c76 100644 (file)
@@ -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 ) )
             {
index a31f7ee701db3b80c735f6dd587f8dead6bcfc72..1570f883b3e91295dde705bdc6a07f999df51355 100644 (file)
@@ -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 )
         {
index dce67ab2f9ece687769548fe4f243526c8524796..7165bd91a31e0356438a27590af1f1e4f9710180 100644 (file)
@@ -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;