changeset 14834:2d919650990a

Have OSS audio out fall back to s16ne instead of u8 if it can't open the soundcard for 3+ channels and do it for all audio streams (not only AC3).
author ivo
date Sat, 26 Feb 2005 23:03:53 +0000
parents 78385a72a8bb
children 056446159745
files help/help_mp-en.h libao2/ao_oss.c
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Sat Feb 26 23:02:09 2005 +0000
+++ b/help/help_mp-en.h	Sat Feb 26 23:03:53 2005 +0000
@@ -940,7 +940,7 @@
 #define MSGTR_AO_OSS_ChanNotFound "[AO OSS] audio_setup: Audio card mixer does not have channel '%s' using default.\n"
 #define MSGTR_AO_OSS_CantOpenDev "[AO OSS] audio_setup: Can't open audio device %s: %s\n"
 #define MSGTR_AO_OSS_CantMakeFd "[AO OSS] audio_setup: Can't make filedescriptor blocking: %s\n"
-#define MSGTR_AO_OSS_CantSetAC3 "[AO OSS] Can't set audio device %s to AC3 output, trying S16...\n"
+#define MSGTR_AO_OSS_CantSet "[AO OSS] Can't set audio device %s to %s output, trying %s...\n"
 #define MSGTR_AO_OSS_CantSetChans "[AO OSS] audio_setup: Failed to set audio device to %d channels.\n"
 #define MSGTR_AO_OSS_CantUseGetospace "[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n"
 #define MSGTR_AO_OSS_CantUseSelect "[AO OSS]\n   ***  Your audio driver DOES NOT support select()  ***\n Recompile MPlayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"
--- a/libao2/ao_oss.c	Sat Feb 26 23:02:09 2005 +0000
+++ b/libao2/ao_oss.c	Sat Feb 26 23:03:53 2005 +0000
@@ -289,8 +289,9 @@
     format=AF_FORMAT_S16_NE;
   }
   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);
+      oss_format != format2oss(format)) {
+    mp_msg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSet, dsp,
+            af_fmt2str_short(format), af_fmt2str_short(AF_FORMAT_S16_NE) );
     format=AF_FORMAT_S16_NE;
     goto ac3_retry;
   }