[vlc-commits] demux: mp4: remove unused restricted read parameter

Francois Cartegnie git at videolan.org
Mon Apr 27 21:36:27 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 16 17:16:09 2020 +0200| [05680a16ceda92452ab915f03f2752ebd6fae0f4] | committer: Francois Cartegnie

demux: mp4: remove unused restricted read parameter

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

 modules/demux/mp4/libmp4.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index d690d41f2e..091a6b2df6 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -369,8 +369,7 @@ static int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t *p_box )
  * on success, position is past read box or EOF
  *****************************************************************************/
 static MP4_Box_t *MP4_ReadBoxRestricted( stream_t *p_stream, MP4_Box_t *p_father,
-                                         const uint32_t onlytypes[], const uint32_t nottypes[],
-                                         bool *pb_restrictionhit )
+                                         const uint32_t stopbefore[], bool *pb_restrictionhit )
 {
     MP4_Box_t peekbox = { 0 };
     if ( !MP4_PeekBoxHeader( p_stream, &peekbox ) )
@@ -383,18 +382,9 @@ static MP4_Box_t *MP4_ReadBoxRestricted( stream_t *p_stream, MP4_Box_t *p_father
         return NULL;
     }
 
-    for( size_t i=0; nottypes && nottypes[i]; i++ )
+    for( size_t i=0; stopbefore && stopbefore[i]; i++ )
     {
-        if( nottypes[i] == peekbox.i_type )
-        {
-            *pb_restrictionhit = true;
-            return NULL;
-        }
-    }
-
-    for( size_t i=0; onlytypes && onlytypes[i]; i++ )
-    {
-        if( onlytypes[i] != peekbox.i_type )
+        if( stopbefore[i] == peekbox.i_type )
         {
             *pb_restrictionhit = true;
             return NULL;
@@ -493,7 +483,7 @@ static int MP4_ReadBoxContainerChildrenIndexed( stream_t *p_stream,
             i_index = GetDWBE(&read[4]);
         }
         b_onexclude = false; /* If stopped due exclude list */
-        if( (p_box = MP4_ReadBoxRestricted( p_stream, p_container, NULL, excludelist, &b_onexclude )) )
+        if( (p_box = MP4_ReadBoxRestricted( p_stream, p_container, excludelist, &b_onexclude )) )
         {
             b_continue = true;
             p_box->i_index = i_index;



More information about the vlc-commits mailing list