[vlc-devel] [PATCH 2/2] input: input: update time offset on each demux iteration
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jul 20 14:48:28 CEST 2018
How is this affected by "input-repeat" ? Because on repeat it does
input_SetTime/input_SetPosition which will affected the cached GET_TIME
that you got. And in the stats you won't have the intended value in
MainLoopStatistics() but the cached value from the previous
MainLoopDemux() call.
On 20/07/2018 10:05, Filip Roséen wrote:
> fixes: #20833
> ---
> src/input/input.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/src/input/input.c b/src/input/input.c
> index 53606c809a..a19887e115 100644
> --- a/src/input/input.c
> +++ b/src/input/input.c
> @@ -600,6 +600,9 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed )
> if( demux_TestAndClearFlags( p_demux, INPUT_UPDATE_TITLE_LIST ) )
> UpdateTitleListfromDemux( p_input );
>
> + if( demux_Control( p_priv->master->p_demux, DEMUX_GET_TIME, &p_priv->i_time ) )
> + p_priv->i_time = 0;
> +
> if( p_priv->master->b_title_demux )
> {
> i_ret = UpdateTitleSeekpointFromDemux( p_input );
> @@ -668,7 +671,6 @@ static void MainLoopStatistics( input_thread_t *p_input )
> {
> input_thread_private_t *priv = input_priv(p_input);
> double f_position = 0.0;
> - vlc_tick_t i_time = 0;
> vlc_tick_t i_length = 0;
>
> /* update input status variables */
> @@ -676,18 +678,14 @@ static void MainLoopStatistics( input_thread_t *p_input )
> DEMUX_GET_POSITION, &f_position ) )
> f_position = 0.0;
>
> - if( demux_Control( priv->master->p_demux, DEMUX_GET_TIME, &i_time ) )
> - i_time = 0;
> - input_priv(p_input)->i_time = i_time;
> -
> if( demux_Control( priv->master->p_demux, DEMUX_GET_LENGTH, &i_length ) )
> i_length = 0;
>
> - es_out_SetTimes( priv->p_es_out, f_position, i_time, i_length );
> + es_out_SetTimes( priv->p_es_out, f_position, priv->i_time, i_length );
>
> /* update current bookmark */
> vlc_mutex_lock( &priv->p_item->lock );
> - priv->bookmark.i_time_offset = i_time;
> + priv->bookmark.i_time_offset = priv->i_time;
>
> if( priv->stats != NULL )
> input_stats_Compute( priv->stats, priv->p_item->p_stats );
> --
> 2.18.0
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list