[vlc-devel] [PATCH] Add support for MPEG-4 ALS to the MP4 demuxer and FFmpeg wrapper.

Laurent Aimar fenrir at via.ecp.fr
Wed Mar 24 09:48:57 CET 2010


Hi,

On Wed, Mar 24, 2010, Alex Converse wrote:
> 
> 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
> ---
>  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..8d86254 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',0x00)
 If possible (ie if the fourcc is arbitray), I would prefer pure
ASCII value, for example using ' ' (a space) instead of 0x00 as it
is nicer when printing.

  
> diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
> index 68b105d..3b85938 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 )
 Is checking the extra data the only way ? (if yes, then it is ok).
> +                {
> +                    p_track->fmt.i_codec = VLC_FOURCC( 'a','l','s',0x00 );
 As said by jb, here using the VLC_CODEC_ALS is better (the rest of the files doesn't
due to historical reasons...)

Regards,

-- 
fenrir




More information about the vlc-devel mailing list