Commit 29d44b6a authored by Rafaël Carré's avatar Rafaël Carré

dts: use VLC_TS_INVALID (refs #3135)

parent f788590c
......@@ -153,6 +153,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
p_sys->i_state = STATE_NOSYNC;
date_Set( &p_sys->end_date, 0 );
p_sys->b_dts_hd = false;
p_sys->i_pts = VLC_TS_INVALID;
p_sys->bytestream = block_BytestreamInit();
......@@ -195,7 +196,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL;
}
if( !date_Get( &p_sys->end_date ) && !(*pp_block)->i_pts )
if( !date_Get( &p_sys->end_date ) && (*pp_block)->i_pts <= VLC_TS_INVALID )
{
/* We've just started the stream, wait for the first PTS. */
block_Release( *pp_block );
......@@ -231,7 +232,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
case STATE_SYNC:
/* New frame, set the Presentation Time Stamp */
p_sys->i_pts = p_sys->bytestream.p_block->i_pts;
if( p_sys->i_pts != 0 &&
if( p_sys->i_pts > VLC_TS_INVALID &&
p_sys->i_pts != date_Get( &p_sys->end_date ) )
{
date_Set( &p_sys->end_date, p_sys->i_pts );
......@@ -322,7 +323,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Make sure we don't reuse the same pts twice */
if( p_sys->i_pts == p_sys->bytestream.p_block->i_pts )
p_sys->i_pts = p_sys->bytestream.p_block->i_pts = 0;
p_sys->i_pts = p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
p_sys->i_state = STATE_NOSYNC;
......
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