From 3fda49a8cbfb7993f4199913c6183fa60db295da Mon Sep 17 00:00:00 2001 From: rtognimp Date: Tue, 28 Dec 2004 01:59:12 +0000 Subject: [PATCH] 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 --- libao2/ao_oss.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index 7fa33e4603..7af6156245 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -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; }