[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.cpp,1.12,1.13 matroska.h,1.2,1.3

Moritz Bunkus CVS mosu at mplayerhq.hu
Sat May 17 22:53:39 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv9787

Modified Files:
	demux_mkv.cpp matroska.h 
Log Message:
Added support for AAC.

Index: demux_mkv.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- demux_mkv.cpp	15 May 2003 10:36:06 -0000	1.12
+++ demux_mkv.cpp	17 May 2003 20:53:12 -0000	1.13
@@ -138,7 +138,7 @@
   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 @@
             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 @@
         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 @@
       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]);

Index: matroska.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/matroska.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- matroska.h	15 May 2003 10:36:06 -0000	1.2
+++ matroska.h	17 May 2003 20:53:12 -0000	1.3
@@ -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"



More information about the MPlayer-cvslog mailing list