From 3dc419b65d1b3ea357aa17a0042bc24e76b594b0 Mon Sep 17 00:00:00 2001 From: mosu Date: Sat, 17 May 2003 20:53:12 +0000 Subject: Added support for AAC. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10126 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mkv.cpp | 16 ++++++++++++++-- libmpdemux/matroska.h | 5 ++++- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'libmpdemux') diff --git a/libmpdemux/demux_mkv.cpp b/libmpdemux/demux_mkv.cpp index c82632d9ae..0b71ce9a12 100644 --- a/libmpdemux/demux_mkv.cpp +++ b/libmpdemux/demux_mkv.cpp @@ -138,7 +138,7 @@ typedef struct mkv_track { uint32_t v_width, v_height, v_dwidth, v_dheight; float v_frate; - uint16_t a_formattag; + uint32_t a_formattag; uint32_t a_channels, a_bps; float a_sfreq; @@ -464,6 +464,10 @@ static int check_track_information(mkv_demuxer_t *d) { t->a_formattag = 0x2000; else if (!strcmp(t->codec_id, MKV_A_PCM)) t->a_formattag = 0x0001; + else if (!strcmp(t->codec_id, MKV_A_AAC_2LC) || + !strcmp(t->codec_id, MKV_A_AAC_4LC) || + !strcmp(t->codec_id, MKV_A_AAC_4SBR)) + t->a_formattag = mmioFOURCC('M', 'P', '4', 'A'); else if (!strcmp(t->codec_id, MKV_A_VORBIS)) { if (t->private_data == NULL) { mp_msg(MSGT_DEMUX, MSGL_WARN, "[mkv] WARNING: CodecID for " @@ -1514,7 +1518,8 @@ extern "C" int demux_mkv_open(demuxer_t *demuxer) { return 0; } } - sh_a->format = sh_a->wf->wFormatTag = track->a_formattag; + sh_a->format = track->a_formattag; + sh_a->wf->wFormatTag = track->a_formattag; sh_a->channels = sh_a->wf->nChannels = track->a_channels; sh_a->samplerate = sh_a->wf->nSamplesPerSec = (uint32_t)track->a_sfreq; if (!strcmp(track->codec_id, MKV_A_MP3)) { @@ -1532,6 +1537,13 @@ extern "C" int demux_mkv_open(demuxer_t *demuxer) { sh_a->wf->nBlockAlign = sh_a->wf->nAvgBytesPerSec; sh_a->wf->wBitsPerSample = track->a_bps; sh_a->samplesize = track->a_bps / 8; + } else if (!strcmp(track->codec_id, MKV_A_AAC_2LC) || + !strcmp(track->codec_id, MKV_A_AAC_4LC) || + !strcmp(track->codec_id, MKV_A_AAC_4SBR)) { + sh_a->wf->nAvgBytesPerSec = 16000; + sh_a->wf->nBlockAlign = 1024; + sh_a->wf->wBitsPerSample = 0; + sh_a->samplesize = 0; } else if (!strcmp(track->codec_id, MKV_A_VORBIS)) { for (i = 0; i < 3; i++) { dp = new_demux_packet(track->header_sizes[i]); diff --git a/libmpdemux/matroska.h b/libmpdemux/matroska.h index 1f016aa132..2dea7c3f55 100644 --- a/libmpdemux/matroska.h +++ b/libmpdemux/matroska.h @@ -7,9 +7,12 @@ #ifndef __MATROSKA_H #define __MATROSKA_H -#define MKV_A_MP3 "A_MPEG/L3" +#define MKV_A_AAC_2LC "A_AAC/MPEG2/LC" +#define MKV_A_AAC_4LC "A_AAC/MPEG4/LC" +#define MKV_A_AAC_4SBR "A_AAC/MPEG4/SBR" #define MKV_A_AC3 "A_AC3" #define MKV_A_DTS "A_DTS" +#define MKV_A_MP3 "A_MPEG/L3" #define MKV_A_PCM "A_PCM/INT/LIT" #define MKV_A_VORBIS "A_VORBIS" #define MKV_A_ACM "A_MS/ACM" -- cgit v1.2.3