[vlc-commits] input: es_out: compute position from buffering only on update

Francois Cartegnie git at videolan.org
Tue Jan 30 10:48:42 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 26 17:52:39 2018 +0100| [5e3a04980044b94bfd5aa38390846544a43a4c21] | committer: Francois Cartegnie

input: es_out: compute position from buffering only on update

Position value from es_out depends on buffering but they are
not updated at the same rate (when not byte based). This causes
growing buffering being substracted from a stalled position (based on
pcr, or other interval) and the computed position to regress as the
position isn't updated yet by demuxer.

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

 src/input/es_out.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 61e92055f8..d25020f1dd 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -175,6 +175,9 @@ struct es_out_sys_t
 
     /* Used only to limit debugging output */
     int         i_prev_stream_level;
+
+    /* For positions updates */
+    double      f_prev_position;
 };
 
 static es_out_id_t *EsOutAdd    ( es_out_t *, const es_format_t * );
@@ -332,6 +335,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, int i_rate )
     p_sys->b_buffering = true;
     p_sys->i_preroll_end = -1;
     p_sys->i_prev_stream_level = -1;
+    p_sys->f_prev_position = -1;
 
     return out;
 }
@@ -2759,10 +2763,10 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
 
         input_SendEventLength( p_sys->p_input, i_length );
 
-        if( !p_sys->b_buffering )
+        if( !p_sys->b_buffering && f_position != p_sys->f_prev_position )
         {
             mtime_t i_delay;
-
+            p_sys->f_prev_position = f_position;
             /* Fix for buffering delay */
             if( !input_priv(p_sys->p_input)->p_sout ||
                 !input_priv(p_sys->p_input)->b_out_pace_control )



More information about the vlc-commits mailing list