]> git.sesse.net Git - vlc/commitdiff
mux ts: Don't do extra copy on every aac packet
authorIlkka Ollakka <ileoo@videolan.org>
Sat, 4 Oct 2014 08:37:28 +0000 (11:37 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Sat, 4 Oct 2014 14:24:59 +0000 (17:24 +0300)
if Realloc fails, we are anyway screwed and most of the code doesn't
chec check for Realloc failures even in this module.

modules/mux/mpeg/ts.c

index ea0a9646302cbb6ebfc6ee754d33e95ba397faa8..fd3e5d57bcf0ffe78ed654c3faf76377fe806d2d 100644 (file)
@@ -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 */