demux: mp4: add support for AV1
[vlc.git] / modules / demux / mp4 / essetup.c
index 177acb7..0af20f8 100644 (file)
@@ -605,14 +605,19 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
         {
             static_assert(ATOM_av01 == VLC_CODEC_AV1, "VLC_CODEC_AV1 != ATOM_av01");
             MP4_Box_t *p_av1C = MP4_BoxGet( p_sample, "av1C" );
-            if( p_av1C && p_av1C->data.p_binary && p_av1C->data.p_binary->i_blob )
+            if( p_av1C && BOXDATA(p_av1C) )
             {
-                p_track->fmt.p_extra = malloc( p_av1C->data.p_binary->i_blob );
-                if( p_track->fmt.p_extra )
+                p_track->fmt.i_profile = BOXDATA(p_av1C)->i_profile;
+                p_track->fmt.i_level = BOXDATA(p_av1C)->i_level;
+                if( BOXDATA(p_av1C)->i_av1C )
                 {
-                    p_track->fmt.i_extra = p_av1C->data.p_binary->i_blob;
-                    memcpy( p_track->fmt.p_extra, p_av1C->data.p_binary->p_blob,
-                            p_av1C->data.p_binary->i_blob );
+                    p_track->fmt.p_extra = malloc( BOXDATA(p_av1C)->i_av1C );
+                    if( p_track->fmt.p_extra )
+                    {
+                        memcpy( p_track->fmt.p_extra, BOXDATA(p_av1C)->p_av1C,
+                                BOXDATA(p_av1C)->i_av1C );
+                        p_track->fmt.i_extra = BOXDATA(p_av1C)->i_av1C;
+                    }
                 }
             }
             break;