--- a/modules/demux/mp4/libmp4.c +++ b/modules/demux/mp4/libmp4.c @@ -3151,6 +3151,7 @@ uint32_t i_type; int (*MP4_ReadBox_function )( stream_t *p_stream, MP4_Box_t *p_box ); void (*MP4_FreeBox_function )( MP4_Box_t *p_box ); + uint32_t i_parent; /* set parent to restrict, duplicating if needed; 0 for any */ } MP4_Box_Function [] = { /* Containers */ @@ -3418,6 +3419,11 @@ /* Now search function to call */ for( i_index = 0; ; i_index++ ) { + if ( MP4_Box_Function[i_index].i_parent && + p_box->p_father && + p_box->p_father->i_type != MP4_Box_Function[i_index].i_parent ) + continue; + if( ( MP4_Box_Function[i_index].i_type == p_box->i_type )|| ( MP4_Box_Function[i_index].i_type == 0 ) ) { @@ -3460,6 +3460,11 @@ void MP4_BoxFree( stream_t *s, MP4_Box_t *p_box ) { for( i_index = 0; ; i_index++ ) { + if ( MP4_Box_Function[i_index].i_parent && + p_box->p_father && + p_box->p_father->i_type != MP4_Box_Function[i_index].i_parent ) + continue; + if( ( MP4_Box_Function[i_index].i_type == p_box->i_type )|| ( MP4_Box_Function[i_index].i_type == 0 ) ) {