[vlc-commits] demux: mp4: use AV1_unpack

Francois Cartegnie git at videolan.org
Wed Oct 17 15:22:16 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 11 15:03:13 2018 +0200| [29eb16af71ad8f4732571afa24dc82a7378f7fce] | committer: Tristan Matthews

demux: mp4: use AV1_unpack

(cherry picked from commit 012a6d58c766774440f1af8df0069b9a03db1d80)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=29eb16af71ad8f4732571afa24dc82a7378f7fce
---

 modules/demux/Makefile.am |  1 +
 modules/demux/mp4/mp4.c   | 19 ++-----------------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/modules/demux/Makefile.am b/modules/demux/Makefile.am
index 9534ea37f9..c6103ad4d1 100644
--- a/modules/demux/Makefile.am
+++ b/modules/demux/Makefile.am
@@ -206,6 +206,7 @@ libmp4_plugin_la_SOURCES = demux/mp4/mp4.c demux/mp4/mp4.h \
                            demux/mp4/fragments.c demux/mp4/fragments.h \
                            demux/mp4/libmp4.c demux/mp4/libmp4.h \
                            demux/mp4/languages.h \
+                           demux/av1_unpack.h \
                            demux/asf/asfpacket.c demux/asf/asfpacket.h \
                            demux/mp4/avci.h \
                            demux/mp4/color_config.h \
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 69c5f5bdb0..6862c71723 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -37,6 +37,7 @@
 #include <assert.h>
 #include <limits.h>
 #include "../codec/cc.h"
+#include "../av1_unpack.h"
 
 /*****************************************************************************
  * Module descriptor
@@ -410,22 +411,6 @@ static int CreateTracks( demux_t *p_demux, unsigned i_tracks )
     return VLC_SUCCESS;
 }
 
-static block_t * MP4_AV1_Convert( block_t *p_block )
-{
-    /* See av1-isobmff 2.4 */
-    if( (p_block->p_buffer[0] & 0x81) == 0 && /* reserved flags */
-        (p_block->p_buffer[0] & 0x7A) != 0x12 ) /* not TEMPORAL_DELIMITER */
-    {
-        p_block = block_Realloc( p_block, 2, p_block->i_buffer );
-        if( p_block )
-        {
-            p_block->p_buffer[0] = 0x12;
-            p_block->p_buffer[1] = 0x00;
-        }
-    }
-    return p_block;
-}
-
 static block_t * MP4_EIA608_Convert( block_t * p_block )
 {
     /* Rebuild codec data from encap */
@@ -584,7 +569,7 @@ static block_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track
     }
     else if( p_track->fmt.i_codec == VLC_CODEC_AV1 )
     {
-        p_block = MP4_AV1_Convert( p_block );
+        p_block = AV1_Unpack_Sample( p_block );
     }
     else if( p_track->fmt.i_original_fourcc == ATOM_rrtp )
     {



More information about the vlc-commits mailing list