changeset 11155:4a21e1672c91

Support for MP2 audio.
author mosu
date Thu, 16 Oct 2003 22:01:30 +0000
parents 0e9ea2a3a220
children 0706b9c769d6
files libmpdemux/demux_mkv.cpp libmpdemux/matroska.h
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.cpp	Thu Oct 16 21:10:18 2003 +0000
+++ b/libmpdemux/demux_mkv.cpp	Thu Oct 16 22:01:30 2003 +0000
@@ -784,7 +784,8 @@
             t->a_formattag = get_uint16(&wfe->wFormatTag);
           }
         } else {
-          if (!strcmp(t->codec_id, MKV_A_MP3))
+          if (!strcmp(t->codec_id, MKV_A_MP3) ||
+              !strcmp(t->codec_id, MKV_A_MP2))
             t->a_formattag = 0x0055;
           else if (!strncmp(t->codec_id, MKV_A_AC3, strlen(MKV_A_AC3)))
             t->a_formattag = 0x2000;
@@ -1836,7 +1837,8 @@
     sh_a->samplerate = (uint32_t)track->a_sfreq;
     sh_a->wf->nSamplesPerSec = (uint32_t)track->a_sfreq;
     sh_a->samplesize = track->a_bps / 8;
-    if (!strcmp(track->codec_id, MKV_A_MP3)) {
+    if (!strcmp(track->codec_id, MKV_A_MP3) ||
+        !strcmp(track->codec_id, MKV_A_MP2)) {
       sh_a->wf->nAvgBytesPerSec = 16000;
       sh_a->wf->nBlockAlign = 1152;
       sh_a->wf->wBitsPerSample = 0;
--- a/libmpdemux/matroska.h	Thu Oct 16 21:10:18 2003 +0000
+++ b/libmpdemux/matroska.h	Thu Oct 16 22:01:30 2003 +0000
@@ -17,6 +17,7 @@
 #define MKV_A_AAC_4SBR   "A_AAC/MPEG4/SBR"
 #define MKV_A_AC3        "A_AC3"
 #define MKV_A_DTS        "A_DTS"
+#define MKV_A_MP2        "A_MPEG/L2"
 #define MKV_A_MP3        "A_MPEG/L3"
 #define MKV_A_PCM        "A_PCM/INT/LIT"
 #define MKV_A_PCM_BE     "A_PCM/INT/BIG"