[vlc-commits] commit: Add support for MPEG-4 ALS to the MP4 demuxer and FFmpeg wrapper. ( Alex Converse )

git at videolan.org git at videolan.org
Fri Mar 26 11:32:16 CET 2010


vlc | branch: master | Alex Converse <alex.converse at gmail.com> | Wed Mar 24 00:08:53 2010 -0400| [df7e8cf916417f2c609571c4aa8e2bbb1b92ea07] | committer: Jean-Baptiste Kempf 

Add support for MPEG-4 ALS to the MP4 demuxer and FFmpeg wrapper.

MPEG-4 ALS is a pure losses audio codec from MPEG. Like other MPEG-4
Audio variants it's muxed into the MP4 container with Object Type
Indication 0x40 followed by its Audio Object Type (36).

Sample:
http://streams.videolan.org/Mpeg_Conformance/ftp.iis.fhg.de/mpeg4audio-conformance/compressedMp4/als_00_2ch48k16b.mp4

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 include/vlc_fourcc.h           |    1 +
 modules/codec/avcodec/fourcc.c |    1 +
 modules/demux/mp4/mp4.c        |    6 ++++++
 src/misc/fourcc.c              |    4 ++++
 4 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index f766933..ad68648 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -194,6 +194,7 @@
 /* Audio codec */
 #define VLC_CODEC_MPGA      VLC_FOURCC('m','p','g','a')
 #define VLC_CODEC_MP4A      VLC_FOURCC('m','p','4','a')
+#define VLC_CODEC_ALS       VLC_FOURCC('a','l','s',' ')
 #define VLC_CODEC_A52       VLC_FOURCC('a','5','2',' ')
 #define VLC_CODEC_EAC3      VLC_FOURCC('e','a','c','3')
 #define VLC_CODEC_DTS       VLC_FOURCC('d','t','s',' ')
diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 96fab55..3fc7a60 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -296,6 +296,7 @@ static const struct
     { VLC_CODEC_MPGA, CODEC_ID_MP3, AUDIO_ES },
 
     { VLC_CODEC_MP4A, CODEC_ID_AAC, AUDIO_ES },
+    { VLC_CODEC_ALS, CODEC_ID_MP4ALS, AUDIO_ES },
 
     { VLC_CODEC_INTERPLAY_DPCM, CODEC_ID_INTERPLAY_DPCM, AUDIO_ES },
 
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 68b105d..923e89a 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -1727,6 +1727,12 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
                 break;
             case( 0x40):
                 p_track->fmt.i_codec = VLC_FOURCC( 'm','p','4','a' );
+                if( p_decconfig->i_decoder_specific_info_len >= 2 &&
+                     p_decconfig->p_decoder_specific_info[0]       == 0xF8 &&
+                    (p_decconfig->p_decoder_specific_info[1]&0xE0) == 0x80 )
+                {
+                    p_track->fmt.i_codec = VLC_CODEC_ALS;
+                }
                 break;
             case( 0x60):
             case( 0x61):
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 95e3bc0..eecebe4 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -875,6 +875,10 @@ static const entry_t p_list_audio[] = {
         A("mp4a"),
         A("aac "),
 
+    /* ALS audio */
+    B(VLC_CODEC_ALS, "MPEG-4 Audio Lossless (ALS)"),
+        A("als "),
+
     /* 4X Technologies */
     B(VLC_CODEC_ADPCM_4XM, "4X Technologies Audio"),
         A("4xma"),



More information about the vlc-commits mailing list