Commit 55b88a40 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

packetizer: dirac: block sanitizing must clean reordering (fix #12051)

(cherry picked from commit fa551675f5a01fd6bfbe72f670aba67ed061d4fa)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c9e14c40
...@@ -1179,6 +1179,34 @@ static int dirac_TimeGenPush( decoder_t *p_dec, block_t *p_block_in ) ...@@ -1179,6 +1179,34 @@ static int dirac_TimeGenPush( decoder_t *p_dec, block_t *p_block_in )
return 0; return 0;
} }
static void dirac_ReorderDequeueAndReleaseBlock( decoder_t *p_dec, block_t *p_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
/* Check if that block is present in reorder queue and release it
if needed */
struct dirac_reorder_entry **pp_at = &p_sys->reorder_buf.p_head;
for( ; *pp_at; pp_at = &(*pp_at)->p_next )
{
/* backup address in case we remove member */
struct dirac_reorder_entry *p_entry = *pp_at;
if ( p_entry->p_eu == p_block )
{
/* unlink member */
*pp_at = (*pp_at)->p_next;
/* Add to empty reorder entry list*/
p_entry->p_next = p_sys->reorder_buf.p_empty;
p_sys->reorder_buf.p_empty = p_entry;
p_sys->reorder_buf.u_size--;
break;
}
}
block_Release( p_block );
}
/***************************************************************************** /*****************************************************************************
* Packetize: form dated encapsulation units from anything * Packetize: form dated encapsulation units from anything
*****************************************************************************/ *****************************************************************************/
...@@ -1307,7 +1335,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -1307,7 +1335,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
block_t *p_block_next = p_block->p_next; block_t *p_block_next = p_block->p_next;
if( p_block->i_pts > VLC_TS_INVALID && p_block->i_dts > VLC_TS_INVALID ) if( p_block->i_pts > VLC_TS_INVALID && p_block->i_dts > VLC_TS_INVALID )
break; break;
block_Release( p_block ); dirac_ReorderDequeueAndReleaseBlock( p_dec, p_block );
p_sys->p_outqueue = p_block = p_block_next; p_sys->p_outqueue = p_block = p_block_next;
} }
} }
......
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