[vlc-devel] [PATCH] Do not rebuffer if not increasing buffer size
David R Robison
drrobison at openroadsconsulting.com
Thu Sep 26 15:41:04 CEST 2013
Any thoughts on this patch? (Yes I did notice that I left a debug
message in and I'll clean it up on the final version of the patch if the
change seems appropriate). Basically, if I am not increasing the buffer
size due to jitter I simply reset the PCR instead of flushing the buffer
and rebuffering. David
David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison at openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526
On 9/25/2013 12:06 PM, David Robison wrote:
> 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 );
> }
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