[vlc-devel] [PATCH] Do not rebuffer if not increasing buffer size

David Robison drrobison at openroadsconsulting.com
Wed Sep 25 18:06:40 CEST 2013


Here is a revised patch (previously the subject was "[PATCH] Option to ignore PCR jitter"). This patch will set the PCR on jitter but will not cause the buffer to be cleared and re-buffered if the amount of buffering is not being increase. Does this seem reasonable?
David


---
 src/input/es_out.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 6b0e9ad..8327079 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -618,6 +618,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
                                          i_preroll_duration +
                                          p_sys->i_buffering_extra_stream - p_sys->i_buffering_extra_initial;
 
+msg_Dbg( p_sys->p_input, "i_stream_duration %d i_buffering_duration %d", i_stream_duration,i_buffering_duration );
     if( i_stream_duration <= i_buffering_duration && !b_forced )
     {
         const double f_level = __MAX( (double)i_stream_duration / i_buffering_duration, 0 );
@@ -2330,19 +2331,23 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
                              "ES_OUT_SET_(GROUP_)PCR  is called too late (jitter of %d ms ignored)",
                              (int)(i_pts_delay - i_pts_delay_base) / 1000 );
                     i_pts_delay = p_sys->i_pts_delay;
+
+                    /* reset clock */
+                    for( int i = 0; i < p_sys->i_pgrm; i++ )
+                      input_clock_Reset( p_sys->pgrm[i]->p_clock );
                 }
                 else
                 {
                     msg_Err( p_sys->p_input,
                              "ES_OUT_SET_(GROUP_)PCR  is called too late (pts_delay increased to %d ms)",
                              (int)(i_pts_delay/1000) );
-                }
 
-                /* Force a rebufferization when we are too late */
+                    /* Force a rebufferization when we are too late */
 
-                /* It is not really good, as we throw away already buffered data
-                 * TODO have a mean to correctly reenter bufferization */
-                es_out_Control( out, ES_OUT_RESET_PCR );
+                    /* It is not really good, as we throw away already buffered data
+                     * TODO have a mean to correctly reenter bufferization */
+                    es_out_Control( out, ES_OUT_RESET_PCR );
+                }
 
                 es_out_SetJitter( out, i_pts_delay_base, i_pts_delay - i_pts_delay_base, p_sys->i_cr_average );
             }
-- 
1.7.9.5

This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.
If you are not the intended recipient, please delete this email immediately.




More information about the vlc-devel mailing list