]> git.sesse.net Git - vlc/commitdiff
* modules/mux/mp4.c: Use SoundDescription instead of SoundDescriptionV1.
authorGildas Bazin <gbazin@videolan.org>
Tue, 7 Oct 2003 14:59:10 +0000 (14:59 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 7 Oct 2003 14:59:10 +0000 (14:59 +0000)
* modules/demux/mp4/*: Added support for the "wave" tag used in mov files with aac.

modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.h
modules/demux/mp4/mp4.c
modules/mux/mp4.c

index 5c95d6d2c2e83ba340aab9aa2da27ac1ab6145b4..789d84c4c5622d0a5243e06914e63b3404268e89 100644 (file)
@@ -2,7 +2,7 @@
  * libmp4.c : LibMP4 library for mp4 module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libmp4.c,v 1.33 2003/09/08 00:35:16 fenrir Exp $
+ * $Id: libmp4.c,v 1.34 2003/10/07 14:59:10 gbazin Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 #include <vlc/input.h>
 
 #ifdef HAVE_ZLIB_H
-#   include <zlib.h>                                     /* for compressed moov */
+#   include <zlib.h>                                  /* for compressed moov */
 #endif
 
 #include "libmp4.h"
@@ -1102,6 +1102,11 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
     {
         i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read );
 
+#ifdef MP4_VERBOSE
+        msg_Dbg( p_stream->p_input, "Found esds MPEG4ESDescr (%dBytes)",
+                i_len );
+#endif
+
         MP4_GET2BYTES( es_descriptor.i_ES_ID );
         MP4_GET1BYTE( i_flags );
         es_descriptor.b_stream_dependence = ( (i_flags&0x80) != 0);
@@ -1137,11 +1142,17 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
 
     if( i_type != 0x04)/* MP4DecConfigDescrTag */
     {
-        es_descriptor.p_decConfigDescr = NULL;
-        MP4_READBOX_EXIT( 1 ); /* rest isn't interesting up to now */
+         es_descriptor.p_decConfigDescr = NULL;
+         MP4_READBOX_EXIT( 1 ); /* rest isn't interesting up to now */
     }
 
     i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read );
+
+#ifdef MP4_VERBOSE
+        msg_Dbg( p_stream->p_input, "Found esds MP4DecConfigDescr (%dBytes)",
+                i_len );
+#endif
+
     es_descriptor.p_decConfigDescr =
             malloc( sizeof( MP4_descriptor_decoder_config_t ));
 
@@ -1161,6 +1172,12 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
     }
 
     i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read );
+
+#ifdef MP4_VERBOSE
+        msg_Dbg( p_stream->p_input, "Found esds MP4DecSpecificDescr (%dBytes)",
+                i_len );
+#endif
+
     es_descriptor.p_decConfigDescr->i_decoder_specific_info_len = i_len;
     es_descriptor.p_decConfigDescr->p_decoder_specific_info = malloc( i_len );
     memcpy( es_descriptor.p_decConfigDescr->p_decoder_specific_info,
@@ -2009,6 +2026,7 @@ static struct
     { FOURCC_rmda,  MP4_ReadBoxContainer,   MP4_FreeBox_Common },
     { FOURCC_tref,  MP4_ReadBoxContainer,   MP4_FreeBox_Common },
     { FOURCC_gmhd,  MP4_ReadBoxContainer,   MP4_FreeBox_Common },
+    { FOURCC_wave,  MP4_ReadBoxContainer,   MP4_FreeBox_Common },
 
     /* specific box */
     { FOURCC_ftyp,  MP4_ReadBox_ftyp,       MP4_FreeBox_ftyp },
index 32176b1037796db1b52810116ecb07c1fcf6a3ee..36cf83a458dd807b7b8f8bc2feef8c4173b26a18 100644 (file)
@@ -2,7 +2,7 @@
  * libmp4.h : LibMP4 library for mp4 module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libmp4.h,v 1.16 2003/09/08 00:35:16 fenrir Exp $
+ * $Id: libmp4.h,v 1.17 2003/10/07 14:59:10 gbazin Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
 #define FOURCC_alis VLC_FOURCC( 'a', 'l', 'i', 's' )
 
 #define FOURCC_gmhd VLC_FOURCC( 'g', 'm', 'h', 'd' )
+#define FOURCC_wave VLC_FOURCC( 'w', 'a', 'v', 'e' )
 
 /* Do you want some debug information on all read boxes ? */
 #define MP4_VERBOSE  1
index 71d9596095b01b28ee322b263a517ec12aa74ecd..004f19d14e6e451f1aef4dc8b8abc1db0b325b06 100644 (file)
@@ -2,7 +2,7 @@
  * mp4.c : MP4 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mp4.c,v 1.39 2003/09/19 21:53:48 fenrir Exp $
+ * $Id: mp4.c,v 1.40 2003/10/07 14:59:10 gbazin Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -984,7 +984,8 @@ static int  TrackCreateES   ( input_thread_t   *p_input,
     /* now see if esds is present and if so create a data packet
         with decoder_specific_info  */
 #define p_decconfig p_esds->data.p_esds->es_descriptor.p_decConfigDescr
-    if( ( p_esds = MP4_BoxGet( p_sample, "esds" ) )&&
+    if( ( ( p_esds = MP4_BoxGet( p_sample, "esds" ) ) ||
+          ( p_esds = MP4_BoxGet( p_sample, "wave/esds" ) ) )&&
         ( p_esds->data.p_esds )&&
         ( p_decconfig ) )
     {
index b8a4410de09c8adcc5402009c30e081ac2c6e576..96b12f133fc7fd9323eece19d2363a8f20f8a2a8 100644 (file)
@@ -2,7 +2,7 @@
  * mp4.c: mp4/mov muxer
  *****************************************************************************
  * Copyright (C) 2001, 2002, 2003 VideoLAN
- * $Id: mp4.c,v 1.4 2003/09/02 16:00:24 gbazin Exp $
+ * $Id: mp4.c,v 1.5 2003/10/07 14:59:10 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -624,8 +624,8 @@ static void Close( vlc_object_t * p_this )
             }
             bo_add_16be( soun, 1 );         // data-reference-index
 
-            /* SoundDescriptionV1 */
-            bo_add_16be( soun, 1 );         // version;
+            /* SoundDescription */
+            bo_add_16be( soun, 0 );         // version;
             bo_add_16be( soun, 0 );         // revision level (0)
             bo_add_32be( soun, 0 );         // vendor
             bo_add_16be( soun, p_stream->p_fmt->i_channels );   // channel-count