[Ffmpeg-devel] Matroska Patch

Michael Niedermayer michaelni
Sat Oct 29 19:47:45 CEST 2005


Hi


On Tue, Oct 18, 2005 at 11:11:45AM +0200, Steve Lhomme wrote:
> Hi,
> 
> Here is a patch to (actually) support (HE-)AAC in Matroska and video 
> Aspect Ratio.
[...]

>  /* IDs in the trackaudio master */
>  #define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
> +#define MATROSKA_ID_AUDIOOUTPUTSAMPLINGFREQ 0x78B5
>  #define MATROSKA_ID_AUDIOBITDEPTH 0x6264
>  #define MATROSKA_ID_AUDIOCHANNELS 0x9F

i somehow feel all these defines should have a few more '_' in them, but 
thats a seperate issue, its ok to keep things consisitantly unreadable 
with this patch


[...]
> +static aac_sampling_frequencies[] = {
> +    96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
> +    16000, 12000, 11025,  8000,     0,     0,     0,     0 };
> +

code duplication see (libavcodec/faad.c and libavformat/mov.c)


[...]
> @@ -2230,11 +2246,56 @@
>                      memcpy(extradata, track->codec_priv, extradata_size);
>                  }
>                  codec_id = CODEC_ID_VORBIS;
> -            } else if (!strcmp(track->codec_id,
> -                               MATROSKA_CODEC_ID_AUDIO_MPEG2) ||
> -                       !strcmp(track->codec_id,
> -                               MATROSKA_CODEC_ID_AUDIO_MPEG4))
> +            } else if (!strncmp(track->codec_id,
> +                               MATROSKA_CODEC_ID_AUDIO_MPEG2, sizeof(MATROSKA_CODEC_ID_AUDIO_MPEG2)-1) ||
> +                       !strncmp(track->codec_id,
> +                               MATROSKA_CODEC_ID_AUDIO_MPEG4, sizeof(MATROSKA_CODEC_ID_AUDIO_MPEG4)-1)) {
> +               /* generate the extradata needed for decoding of raw AAC */
> +               char *p_codec_info = (char*)track->codec_id + sizeof(MATROSKA_CODEC_ID_AUDIO_MPEG4)-1;
> +               int SRI;
> +               int profile;
> +               int sbr = 0;
> +               char *b;
> +                for (SRI=0; SRI<sizeof(aac_sampling_frequencies); SRI++)

something is wrong with the indention here, its supposed to be x*4 space

[...]

-- 
Michael





More information about the ffmpeg-devel mailing list