Commit f12eff4d authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: dts: forward discontinuities

parent 1cecce83
......@@ -65,6 +65,7 @@ struct decoder_sys_t
bool b_date_set;
mtime_t i_pts;
bool b_discontinuity;
vlc_dts_header_t dts;
};
......@@ -73,6 +74,7 @@ static void PacketizeFlush( decoder_t *p_dec )
{
decoder_sys_t *p_sys = p_dec->p_sys;
p_sys->b_discontinuity = true;
date_Set( &p_sys->end_date, 0 );
p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream );
......@@ -135,7 +137,10 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL;
}
else /* BLOCK_FLAG_DISCONTINUITY */
{
p_sys->b_discontinuity = true;
date_Set( &p_sys->end_date, 0 );
}
}
......@@ -269,6 +274,12 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
if( p_sys->i_pts == p_sys->bytestream.p_block->i_pts )
p_sys->i_pts = p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
if( p_sys->b_discontinuity )
{
p_sys->b_discontinuity = false;
p_out_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
}
/* So p_block doesn't get re-added several times */
*pp_block = block_BytestreamPop( &p_sys->bytestream );
......@@ -311,6 +322,7 @@ static int Open( vlc_object_t *p_this )
date_Set( &p_sys->end_date, 0 );
p_sys->i_pts = VLC_TS_INVALID;
p_sys->b_date_set = false;
p_sys->b_discontinuity = false;
block_BytestreamInit( &p_sys->bytestream );
......
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