[vlc-commits] demux: libmp4: handle ASF atom

Francois Cartegnie git at videolan.org
Mon Oct 6 13:59:14 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Oct  5 20:46:51 2014 +0200| [f103d3834d30d37f7c3c8cc2c968b4b1f7af09c6] | committer: Francois Cartegnie

demux: libmp4: handle ASF atom

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

 modules/demux/mp4/libmp4.c |   17 +++++++++++++++++
 modules/demux/mp4/libmp4.h |    7 +++++++
 2 files changed, 24 insertions(+)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 87a1654..8e8a9ca 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -1539,6 +1539,21 @@ static void MP4_FreeBox_strf( MP4_Box_t *p_box )
     FREENULL( p_box->data.p_strf->p_extra );
 }
 
+static int MP4_ReadBox_ASF( stream_t *p_stream, MP4_Box_t *p_box )
+{
+    MP4_READBOX_ENTER( MP4_Box_data_ASF_t );
+
+    MP4_Box_data_ASF_t *p_asf = p_box->data.p_asf;
+
+    if (i_read != 8)
+        MP4_READBOX_EXIT( 0 );
+
+    MP4_GET1BYTE( p_asf->i_stream_number );
+    /* remaining is unknown */
+
+    MP4_READBOX_EXIT( 1 );
+}
+
 static int MP4_ReadBox_stsdext_chan( stream_t *p_stream, MP4_Box_t *p_box )
 {
     MP4_READBOX_ENTER( MP4_Box_data_chan_t );
@@ -3607,6 +3622,8 @@ static const struct
     { ATOM_yuv2,    MP4_ReadBox_sample_vide,  MP4_FreeBox_sample_vide, 0 },
 
     { ATOM_strf,    MP4_ReadBox_strf,         MP4_FreeBox_strf,        ATOM_WMV3 }, /* flip4mac */
+    { ATOM_ASF ,    MP4_ReadBox_ASF,          MP4_FreeBox_Common,      ATOM_WMV3 }, /* flip4mac */
+    { ATOM_ASF ,    MP4_ReadBox_ASF,          MP4_FreeBox_Common,      ATOM_wave }, /* flip4mac */
 
     { ATOM_mp4s,    MP4_ReadBox_sample_mp4s,  MP4_FreeBox_Common, 0 },
 
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index bc1c0de..d3ee338 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -214,6 +214,7 @@
 #define ATOM_drmi VLC_FOURCC( 'd', 'r', 'm', 'i' )
 #define ATOM_frma VLC_FOURCC( 'f', 'r', 'm', 'a' )
 #define ATOM_skcr VLC_FOURCC( 's', 'k', 'c', 'r' )
+#define ATOM_ASF  VLC_FOURCC( 'A', 'S', 'F', ' ' )
 
 #define ATOM_text VLC_FOURCC( 't', 'e', 'x', 't' )
 #define ATOM_tx3g VLC_FOURCC( 't', 'x', '3', 'g' )
@@ -1061,6 +1062,11 @@ typedef struct
     char    *p_extra;
 } MP4_Box_data_strf_t;
 
+typedef struct
+{
+    uint8_t i_stream_number;
+} MP4_Box_data_ASF_t;
+
 /* According to Apple's CoreAudio/CoreAudioTypes.h */
 #define MP4_CHAN_USE_CHANNELS_DESC           0
 #define MP4_CHAN_USE_CHANNELS_BITMAP         (1<<16)
@@ -1380,6 +1386,7 @@ typedef union MP4_Box_data_s
     MP4_Box_data_hvcC_t *p_hvcC;
     MP4_Box_data_WMA2_t *p_WMA2; /* flip4mac Little endian audio config */
     MP4_Box_data_strf_t *p_strf; /* flip4mac Little endian video config */
+    MP4_Box_data_ASF_t  *p_asf;  /* flip4mac asf streams indicator */
 
     MP4_Box_data_data_t *p_data;
 



More information about the vlc-commits mailing list