[vlc-commits] demux: adaptive: use libmp4 de/allocators

Francois Cartegnie git at videolan.org
Wed Aug 3 14:49:38 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Aug  3 14:00:59 2016 +0200| [11d35ea8e9148f0f25f930fb1fc3408b88996f88] | committer: Francois Cartegnie

demux: adaptive: use libmp4 de/allocators

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

 modules/demux/adaptive/mp4/AtomsReader.cpp | 10 ++--------
 modules/demux/mp4/libmp4.c                 |  2 +-
 modules/demux/mp4/libmp4.h                 |  1 -
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/modules/demux/adaptive/mp4/AtomsReader.cpp b/modules/demux/adaptive/mp4/AtomsReader.cpp
index 43e342b..117af64 100644
--- a/modules/demux/adaptive/mp4/AtomsReader.cpp
+++ b/modules/demux/adaptive/mp4/AtomsReader.cpp
@@ -39,13 +39,7 @@ AtomsReader::~AtomsReader()
 
 void AtomsReader::clean()
 {
-    while(rootbox && rootbox->p_first)
-    {
-        MP4_Box_t *p_next = rootbox->p_first->p_next;
-        MP4_BoxFree( rootbox->p_first );
-        rootbox->p_first = p_next;
-    }
-    delete rootbox;
+    MP4_BoxFree(rootbox);
     rootbox = NULL;
 }
 
@@ -57,7 +51,7 @@ bool AtomsReader::parseBlock(block_t *p_block)
     stream_t *stream = vlc_stream_MemoryNew( object, p_block->p_buffer, p_block->i_buffer, true);
     if (stream)
     {
-        rootbox = new (std::nothrow) MP4_Box_t;
+        rootbox = MP4_BoxNew(ATOM_root);
         if(!rootbox)
         {
             vlc_stream_Delete(stream);
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 4242b99..e4bbd49 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2214,7 +2214,7 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
     MP4_READBOX_EXIT( 1 );
 }
 
-void MP4_FreeBox_sample_vide( MP4_Box_t *p_box )
+static void MP4_FreeBox_sample_vide( MP4_Box_t *p_box )
 {
     FREENULL( p_box->data.p_sample_vide->p_qt_image_description );
 }
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index acd2fde..95ad3fe 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -1850,6 +1850,5 @@ int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t *p_box );
 int MP4_ReadBoxContainerChildren( stream_t *p_stream, MP4_Box_t *p_container,
                                   const uint32_t stoplist[] );
 int MP4_ReadBox_sample_vide( stream_t *p_stream, MP4_Box_t *p_box );
-void MP4_FreeBox_sample_vide( MP4_Box_t *p_box );
 
 #endif



More information about the vlc-commits mailing list