Browse Source

packetizer: helper: handle AU_END flag

Using the AU_END hint, we don't need to wait the
next sync code as we know that last block is complete.
Helps cutting 1frame duration, which really helps in low fps.
pull/85/head
Francois Cartegnie 8 years ago
parent
commit
81dfea36cc
  1. 10
      modules/packetizer/packetizer_helper.h

10
modules/packetizer/packetizer_helper.h

@ -171,7 +171,8 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
NULL, &p_pack->i_offset, NULL );
p_pack->i_offset -= p_pack->bytestream.i_block_offset;
if( p_pack->i_offset <= (size_t)p_pack->i_startcode )
if( p_pack->i_offset <= (size_t)p_pack->i_startcode &&
(p_pack->bytestream.p_block->i_flags & BLOCK_FLAG_AU_END) == 0 )
return NULL;
}
@ -184,6 +185,13 @@ static inline block_t *packetizer_Packetize( packetizer_t *p_pack, block_t **pp_
p_pic->i_pts = p_block_bytestream->i_pts;
p_pic->i_dts = p_block_bytestream->i_dts;
/* Do not wait for next sync code if notified block ends AU */
if( (p_block_bytestream->i_flags & BLOCK_FLAG_AU_END) &&
p_block_bytestream->i_buffer == p_pack->i_offset )
{
p_pic->i_flags |= BLOCK_FLAG_AU_END;
}
block_GetBytes( &p_pack->bytestream, &p_pic->p_buffer[p_pack->i_au_prepend],
p_pic->i_buffer - p_pack->i_au_prepend );
if( p_pack->i_au_prepend > 0 )

Loading…
Cancel
Save