[vlc-commits] demux: asf: the 'unknown' guid is binary media format

Francois Cartegnie git at videolan.org
Mon Feb 13 18:13:32 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 13 18:10:40 2017 +0100| [87dd6f65131b00073936f7bf2e8740ca8f2fc7ad] | committer: Francois Cartegnie

demux: asf: the 'unknown' guid is binary media format

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

 modules/demux/asf/asf.c         | 26 ++++++++++++++++++++++----
 modules/demux/asf/libasf_guid.h |  6 +++---
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index db99029..2c1b4ea 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -1051,16 +1051,34 @@ static int DemuxInit( demux_t *p_demux )
             msg_Dbg( p_demux, "added new video stream(ID:%d)",
                      p_sp->i_stream_number );
         }
-        else if( guidcmp( &p_sp->i_stream_type, &asf_object_extended_stream_header ) &&
+        else if( guidcmp( &p_sp->i_stream_type, &asf_object_stream_type_binary ) &&
             p_sp->i_type_specific_data_length >= 64 )
         {
-            /* Now follows a 64 byte header of which we don't know much */
-            guid_t  *p_ref  = (guid_t *)p_sp->p_type_specific_data;
+            guid_t i_major_media_type;
+            ASF_GetGUID( &i_major_media_type, p_sp->p_type_specific_data );
+            msg_Dbg( p_demux, "stream(ID:%d) major type " GUID_FMT, p_sp->i_stream_number,
+                     GUID_PRINT(i_major_media_type) );
+
+            guid_t i_media_subtype;
+            ASF_GetGUID( &i_media_subtype, &p_sp->p_type_specific_data[16] );
+            msg_Dbg( p_demux, "stream(ID:%d) subtype " GUID_FMT, p_sp->i_stream_number,
+                     GUID_PRINT(i_media_subtype) );
+
+            //uint32_t i_fixed_size_samples = GetDWBE( &p_sp->p_type_specific_data[32] );
+            //uint32_t i_temporal_compression = GetDWBE( &p_sp->p_type_specific_data[36] );
+            //uint32_t i_sample_size = GetDWBE( &p_sp->p_type_specific_data[40] );
+
+            guid_t i_format_type;
+            ASF_GetGUID( &i_format_type, &p_sp->p_type_specific_data[44] );
+            msg_Dbg( p_demux, "stream(ID:%d) format type " GUID_FMT, p_sp->i_stream_number,
+                     GUID_PRINT(i_format_type) );
+
+            //uint32_t i_format_data_size = GetDWBE( &p_sp->p_type_specific_data[60] );
             uint8_t *p_data = p_sp->p_type_specific_data + 64;
             unsigned int i_data = p_sp->i_type_specific_data_length - 64;
 
             msg_Dbg( p_demux, "Ext stream header detected. datasize = %d", p_sp->i_type_specific_data_length );
-            if( guidcmp( p_ref, &asf_object_extended_stream_type_audio ) &&
+            if( guidcmp( &i_major_media_type, &asf_object_extended_stream_type_audio ) &&
                 i_data >= sizeof( WAVEFORMATEX ) - 2)
             {
                 uint16_t i_format;
diff --git a/modules/demux/asf/libasf_guid.h b/modules/demux/asf/libasf_guid.h
index ff327af..0d0f642 100644
--- a/modules/demux/asf/libasf_guid.h
+++ b/modules/demux/asf/libasf_guid.h
@@ -120,6 +120,9 @@ static const guid_t asf_object_stream_type_video =
 static const guid_t asf_object_stream_type_command =
 {0x59DACFC0, 0x59E6, 0x11D0, {0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}};
 
+static const guid_t asf_object_stream_type_binary =
+{0x3AFB65E2, 0x47EF, 0x40F2, {0xAC, 0x2C, 0x70, 0xA9, 0x0D, 0x71, 0xD3, 0x43}};
+
 /* TODO */
 // top-level
 static const guid_t asf_object_media_index_guid =
@@ -185,9 +188,6 @@ static const guid_t asf_object_advanced_content_encryption_guid =
 {0x43058533, 0x6981, 0x49E6, {0x9B, 0x74, 0xAD, 0x12, 0xCB, 0x86, 0xD5, 0x8C}};
 
 //
-static const guid_t asf_object_extended_stream_header =
-{0x3AFB65E2, 0x47EF, 0x40F2, {0xAC, 0x2C, 0x70, 0xA9, 0x0D, 0x71, 0xD3, 0x43}};
-
 static const guid_t asf_object_extended_stream_type_audio =
 {0x31178C9D, 0x03E1, 0x4528, {0xB5, 0x82, 0x3D, 0xF9, 0xDB, 0x22, 0xF5, 0x03}};
 



More information about the vlc-commits mailing list