Commit 350b1da9 authored by Laurent Aimar's avatar Laurent Aimar

Fixed decoder_GetDisplayDate while buffering.

parent 25a8f939
......@@ -590,8 +590,11 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_sys->i_pts = p_sys->p_ff_pic->pts;
/* Update frame late count (except when doing preroll) */
if( p_sys->i_pts && decoder_GetDisplayDate(p_dec, p_sys->i_pts) <= mdate() &&
!(p_block->i_flags & BLOCK_FLAG_PREROLL) )
mtime_t i_display_date = 0;
if( !(p_block->i_flags & BLOCK_FLAG_PREROLL) )
i_display_date = decoder_GetDisplayDate( p_dec, p_sys->i_pts );
i_display_date = 0;
if( i_display_date > 0 && i_display_date <= mdate() )
{
p_sys->i_late_frames++;
if( p_sys->i_late_frames == 1 )
......
......@@ -573,7 +573,12 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
if( p_sys->i_out_frames <= 0 )
{
p_sys->pts = p_block->i_pts;
if( decoder_GetDisplayDate( p_dec, p_block->i_pts ) < mdate() )
mtime_t i_display_date = 0;
if( !(p_block->i_flags & BLOCK_FLAG_PREROLL) )
i_display_date = decoder_GetDisplayDate( p_dec, p_block->i_pts );
if( i_display_date > 0 && i_display_date < mdate() )
{
block_Release( p_block );
*pp_block = NULL;
......@@ -894,7 +899,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
i_pts = p_block->i_pts ? p_block->i_pts : p_block->i_dts;
if( decoder_GetDisplayDate( p_dec, i_pts ) < mdate() )
mtime_t i_display_date = 0;
if( !(p_block->i_flags & BLOCK_FLAG_PREROLL) )
i_display_date = decoder_GetDisplayDate( p_dec, i_pts );
if( i_display_date > 0 && i_display_date < mdate() )
{
p_sys->i_late++;
}
......
......@@ -185,8 +185,14 @@ mtime_t decoder_GetDisplayDate( decoder_t *p_dec, mtime_t i_ts )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
if( !p_owner->p_clock )
vlc_mutex_lock( &p_owner->lock );
if( p_owner->b_buffering )
i_ts = 0;
vlc_mutex_unlock( &p_owner->lock );
if( !p_owner->p_clock || !i_ts )
return i_ts;
return input_clock_GetTS( p_owner->p_clock, NULL, p_owner->p_input->i_pts_delay, i_ts );
}
/* decoder_GetDisplayRate:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment