1
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:33:46 +01:00

ao_oss was not using the channel & format returned by the soundcard

for ao_data.bps calcualtion - hence fscked up av sync if soundcard didn't
support a number of channels or audio format.

patch by Balatoni Denes <pnis@coder.hu>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8604 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-12-28 13:45:04 +00:00
parent d3b9403406
commit bd814ee879

View File

@ -126,10 +126,6 @@ static int init(int rate,int channels,int format,int flags){
fcntl(audio_fd, F_SETFD, FD_CLOEXEC);
#endif
ao_data.bps=channels;
if(format != AFMT_U8 && format != AFMT_S8)
ao_data.bps*=2;
if(format == AFMT_AC3) {
ao_data.samplerate=rate;
ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate);
@ -223,8 +219,12 @@ ac3_retry:
#endif
}
ao_data.bps=ao_data.channels;
if(ao_data.format != AFMT_U8 && ao_data.format != AFMT_S8)
ao_data.bps*=2;
ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down
ao_data.bps*=rate;
ao_data.bps*=ao_data.samplerate;
return 1;
}