1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-18 21:31:13 +00:00

100l set default format for AF_FORMATs not supported by sound card

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14261 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rtognimp 2004-12-28 01:59:12 +00:00
parent 37644a0cee
commit 3fda49a8cb

View File

@ -256,16 +256,22 @@ static int init(int rate,int channels,int format,int flags){
ac3_retry:
ao_data.format=format;
oss_format=format2oss(format);
if (oss_format == -1) return 0;
if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &oss_format)<0 ||
oss_format != format2oss(format)) if(format == AF_FORMAT_AC3){
mp_msg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSetAC3, dsp);
if (oss_format == -1) {
#ifdef WORDS_BIGENDIAN
oss_format=AFMT_S16_BE;
format=AF_FORMAT_S16_BE;
#else
oss_format=AFMT_S16_LE;
format=AF_FORMAT_S16_LE;
#endif
}
if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &oss_format)<0 ||
oss_format != format2oss(format)) if(format == AF_FORMAT_AC3){
mp_msg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSetAC3, dsp);
#ifdef WORDS_BIGENDIAN
format=AF_FORMAT_S16_BE;
#else
format=AF_FORMAT_S16_LE;
#endif
goto ac3_retry;
}