From c412ed42412d3bcab5e40ebae258e7970506f0c3 Mon Sep 17 00:00:00 2001 From: arpi_esp Date: Sat, 14 Apr 2001 15:25:11 +0000 Subject: [PATCH] DVD PCM audio support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@402 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/codecs.conf | 6 ++++++ codec-cfg.c | 1 + dec_audio.c | 24 +++++++++++++----------- mplayer.c | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/DOCS/codecs.conf b/DOCS/codecs.conf index 5b12167313..f9fbc53dd7 100644 --- a/DOCS/codecs.conf +++ b/DOCS/codecs.conf @@ -317,6 +317,12 @@ audiocodec pcm format 0x1 driver pcm +audiocodec dvdpcm + info "Uncompressed DVD PCM" + status working + format 0x10001 + driver dvdpcm + audiocodec ac3 info "AC3" status working diff --git a/codec-cfg.c b/codec-cfg.c index 4348f634ae..967c0f82cb 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -201,6 +201,7 @@ static short get_driver(char *s,int audioflag) "alaw", "msgsm", "dshow", + "dvdpcm", NULL }; static char *videodrv[] = { diff --git a/dec_audio.c b/dec_audio.c index 35ebb0cb48..5b78d61040 100644 --- a/dec_audio.c +++ b/dec_audio.c @@ -5,7 +5,7 @@ int driver=sh_audio->codec->driver; 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 @@ case 4: { 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 @@ int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int maxlen){ 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;jtype); 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 }