changeset 401:835fac6382be

DVD PCM audio support
author arpi_esp
date Sat, 14 Apr 2001 15:25:11 +0000
parents ae91bfef2a94
children 9ff4d45e8cdf
files DOCS/codecs.conf codec-cfg.c dec_audio.c mplayer.c
diffstat 4 files changed, 21 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/codecs.conf	Sat Apr 14 03:13:48 2001 +0000
+++ b/DOCS/codecs.conf	Sat Apr 14 15:25:11 2001 +0000
@@ -317,6 +317,12 @@
   format 0x1
   driver pcm
 
+audiocodec dvdpcm
+  info "Uncompressed DVD PCM"
+  status working
+  format 0x10001
+  driver dvdpcm
+
 audiocodec ac3
   info "AC3"
   status working
--- a/codec-cfg.c	Sat Apr 14 03:13:48 2001 +0000
+++ b/codec-cfg.c	Sat Apr 14 15:25:11 2001 +0000
@@ -201,6 +201,7 @@
 		"alaw",
 		"msgsm",
 		"dshow",
+		"dvdpcm",
 		NULL
 	};
 	static char *videodrv[] = {
--- a/dec_audio.c	Sat Apr 14 03:13:48 2001 +0000
+++ b/dec_audio.c	Sat Apr 14 15:25:11 2001 +0000
@@ -5,7 +5,7 @@
 
 sh_audio->samplesize=2;
 sh_audio->samplerate=0;
-sh_audio->pcm_bswap=0;
+//sh_audio->pcm_bswap=0;
 
 sh_audio->a_buffer_size=16384;  // default size, maybe not enough for Win32/ACM
 sh_audio->a_buffer=NULL;
@@ -63,18 +63,18 @@
     break;
 }
 case 2: {
-//  if(file_format==DEMUXER_TYPE_AVI){    // FIXME!!!!!!!
     // AVI PCM Audio:
     WAVEFORMATEX *h=&sh_audio->wf;
     sh_audio->channels=h->nChannels;
     sh_audio->samplerate=h->nSamplesPerSec;
     sh_audio->samplesize=(h->wBitsPerSample+7)/8;
-//  } else {
-//    // DVD PCM audio:
-//    sh_audio->channels=2;
-//    sh_audio->samplerate=48000;
+    break;
+}
+case 8: {
+    // DVD PCM Audio:
+    sh_audio->channels=2;
+    sh_audio->samplerate=48000;
 //    sh_audio->pcm_bswap=1;
-//  }
     break;
 }
 case 3: {
@@ -149,17 +149,19 @@
         len=MP3_DecodeFrame(buf,-1);
         sh_audio->channels=2; // hack
         break;
-      case 2: // PCM
+      case 2: // AVI PCM
       { len=demux_read_data(sh_audio->ds,buf,OUTBURST);
-        if(sh_audio->pcm_bswap){
-          int j;
+        break;
+      }
+      case 8: // DVD PCM
+      { int j;
+        len=demux_read_data(sh_audio->ds,buf,OUTBURST);
           //if(i&1){ printf("Warning! pcm_audio_size&1 !=0  (%d)\n",i);i&=~1; }
           for(j=0;j<len;j+=2){
             char x=buf[j];
             buf[j]=buf[j+1];
             buf[j+1]=x;
           }
-        }
         break;
       }
       case 5:  // aLaw decoder
--- a/mplayer.c	Sat Apr 14 03:13:48 2001 +0000
+++ b/mplayer.c	Sat Apr 14 15:25:11 2001 +0000
@@ -728,7 +728,7 @@
     if(verbose) printf("detected MPG-PS audio format: %d\n",d_audio->type);
     switch(d_audio->type){
       case 1: sh_audio->format=0x50;break; // mpeg
-      case 2: sh_audio->format=0x2;break;  // pcm
+      case 2: sh_audio->format=0x10001;break;  // dvd pcm
       case 3: sh_audio->format=0x2000;break; // ac3
       default: has_audio=0; // unknown type
     }