[vlc-commits] mux ts: Don't do extra copy on every aac packet

Ilkka Ollakka git at videolan.org
Sat Oct 4 16:57:27 CEST 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Oct  4 11:37:28 2014 +0300| [2170013590c25fa12939f879e77c10cb7b7b2941] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2170013590c25fa12939f879e77c10cb7b7b2941
---

 modules/mux/mpeg/ts.c |   11 -----------
 1 file changed, 11 deletions(-)

diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index ea0a964..fd3e5d5 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -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 */



More information about the vlc-commits mailing list