Commit 21700135 authored by Ilkka Ollakka's avatar Ilkka Ollakka

mux ts: Don't do extra copy on every aac packet

if Realloc fails, we are anyway screwed and most of the code doesn't
chec check for Realloc failures even in this module.
parent f6da7e32
......@@ -1691,19 +1691,8 @@ static block_t *Add_ADTS( block_t *p_data, es_format_t *p_fmt )
int i_channels = (p_extra[i_index == 0x0f ? 4 : 1] >> 3) & 0x0f;
/* keep a copy in case block_Realloc() fails */
block_t *p_bak_block = block_Duplicate( p_data );
if( !p_bak_block ) /* OOM, block_Realloc() is likely to lose our block */
return p_data; /* the frame isn't correct but that's the best we have */
block_t *p_new_block = block_Realloc( p_data, ADTS_HEADER_SIZE,
p_data->i_buffer );
if( !p_new_block )
return p_bak_block; /* OOM, send the (incorrect) original frame */
block_Release( p_bak_block ); /* we don't need the copy anymore */
uint8_t *p_buffer = p_new_block->p_buffer;
/* fixed header */
......
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