mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +00:00
first attempt to make 24-bit PCM DVDs work
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13237 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
04ecde13b1
commit
13abc1ced2
@ -4,6 +4,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "ad_internal.h"
|
||||
#include "../libaf/af_format.h"
|
||||
|
||||
static ad_info_t info =
|
||||
{
|
||||
@ -29,12 +30,28 @@ static int init(sh_audio_t *sh)
|
||||
case 2: sh->samplerate=44100;break;
|
||||
case 3: sh->samplerate=32000;break;
|
||||
}
|
||||
switch ((h >> 6) & 3) {
|
||||
case 0:
|
||||
sh->sample_format = AFMT_S16_BE;
|
||||
sh->samplesize = 2;
|
||||
break;
|
||||
case 2:
|
||||
sh->sample_format = AFMT_AF_FLAGS | AF_FORMAT_I |
|
||||
AF_FORMAT_BE | AF_FORMAT_US;
|
||||
sh->samplesize = 3;
|
||||
break;
|
||||
default:
|
||||
sh->sample_format = AFMT_S16_BE;
|
||||
sh->samplesize = 2;
|
||||
}
|
||||
} else {
|
||||
// use defaults:
|
||||
sh->channels=2;
|
||||
sh->samplerate=48000;
|
||||
sh->sample_format = AFMT_S16_BE;
|
||||
sh->samplesize = 2;
|
||||
}
|
||||
sh->i_bps=2*sh->channels*sh->samplerate;
|
||||
sh->i_bps = sh->samplesize * sh->channels * sh->samplerate;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -66,12 +83,5 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m
|
||||
{
|
||||
int j,len;
|
||||
len=demux_read_data(sh_audio->ds,buf,(minlen+3)&(~3));
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
for(j=0;j<len;j+=2){
|
||||
char x=buf[j];
|
||||
buf[j]=buf[j+1];
|
||||
buf[j+1]=x;
|
||||
}
|
||||
#endif
|
||||
return len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user