[vlc-commits] demux: libmp4: add support for disk meta

Francois Cartegnie git at videolan.org
Thu Oct 16 20:05:21 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 16 18:08:49 2014 +0200| [af3ab2456b74f07e2e11c911c595a6072d2a9b75] | committer: Francois Cartegnie

demux: libmp4: add support for disk meta

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

 modules/demux/mp4/libmp4.c |    1 +
 modules/demux/mp4/libmp4.h |    1 +
 modules/demux/mp4/meta.c   |   14 ++++++++++++++
 3 files changed, 16 insertions(+)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index f0c4433..c1e5d3a 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -3712,6 +3712,7 @@ static const struct
     { ATOM_0xa9wrt, MP4_ReadBox_0xa9xxx,      MP4_FreeBox_0xa9xxx, ATOM_ilst },
     { ATOM_chpl,    MP4_ReadBox_chpl,         MP4_FreeBox_chpl,    ATOM_ilst },
     { ATOM_covr,    MP4_ReadBoxContainer,     MP4_FreeBox_Common,  ATOM_ilst },
+    { ATOM_disk,    MP4_ReadBox_Metadata,     MP4_FreeBox_Common,  ATOM_ilst },
     { ATOM_gnre,    MP4_ReadBox_Metadata,     MP4_FreeBox_Common,  ATOM_ilst },
     { ATOM_trkn,    MP4_ReadBox_Metadata,     MP4_FreeBox_Common,  ATOM_ilst },
 
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 29ba812..df78f4f 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -279,6 +279,7 @@
 #define ATOM_0xa9xpd VLC_FOURCC( 0xa9, 'x', 'p', 'd' )
 #define ATOM_0xa9xyz VLC_FOURCC( 0xa9, 'x', 'y', 'z' )
 #define ATOM_chpl VLC_FOURCC( 'c', 'h', 'p', 'l' )
+#define ATOM_disk VLC_FOURCC( 'd', 'i', 's', 'k' )
 #define ATOM_WLOC VLC_FOURCC( 'W', 'L', 'O', 'C' )
 
 #define ATOM_meta VLC_FOURCC( 'm', 'e', 't', 'a' )
diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
index 480a3e8..a17a385 100644
--- a/modules/demux/mp4/meta.c
+++ b/modules/demux/mp4/meta.c
@@ -242,6 +242,20 @@ static void SetupmdirMeta( vlc_meta_t *p_meta, MP4_Box_t *p_box )
     /* XXX Becarefull p_udta can have box that are not 0xa9xx */
     switch( p_box->i_type )
     {
+    case ATOM_disk:
+    {
+        const MP4_Box_t *p_data = MP4_BoxGet( p_box, "data" );
+        if ( p_data && BOXDATA(p_data) && BOXDATA(p_data)->i_blob >= 6 &&
+             BOXDATA(p_data)->e_wellknowntype == DATA_WKT_RESERVED )
+        {
+            char psz_utf[5 + 5 + 4];
+            snprintf( psz_utf, sizeof( psz_utf ), "%"PRIu16" / %"PRIu16,
+                      GetWBE(&BOXDATA(p_data)->p_blob[2]),
+                      GetWBE(&BOXDATA(p_data)->p_blob[4]) );
+            vlc_meta_AddExtra( p_meta, N_("Disc"), psz_utf );
+        }
+        break;
+    }
     case ATOM_gnre:
     {
         const MP4_Box_t *p_data = MP4_BoxGet( p_box, "data" );



More information about the vlc-commits mailing list