[Mplayer-cvslog] CVS: main/libao2 ao_alsa5.c,1.9,1.10 ao_alsa9.c,1.13,1.14 ao_nas.c,1.3,1.4 ao_oss.c,1.20,1.21

Arpi of Ize arpi at mplayerhq.hu
Tue Apr 23 00:33:09 CEST 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv6353

Modified Files:
	ao_alsa5.c ao_alsa9.c ao_nas.c ao_oss.c 
Log Message:
AFMT_AC3 autodetect/fallback to S16

Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ao_alsa5.c	24 Dec 2001 10:35:42 -0000	1.9
+++ ao_alsa5.c	22 Apr 2002 22:33:06 -0000	1.10
@@ -87,9 +87,15 @@
 	case AFMT_U16_BE:
 	    alsa_format.format = SND_PCM_SFMT_U16_BE;
 	    break;
+#ifndef WORDS_BIGENDIAN
+	case AFMT_AC3:
+#endif
 	case AFMT_S16_LE:
 	    alsa_format.format = SND_PCM_SFMT_S16_LE;
 	    break;
+#ifdef WORDS_BIGENDIAN
+	case AFMT_AC3:
+#endif
 	case AFMT_S16_BE:
 	    alsa_format.format = SND_PCM_SFMT_S16_BE;
 	    break;

Index: ao_alsa9.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa9.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ao_alsa9.c	26 Nov 2001 02:16:01 -0000	1.13
+++ ao_alsa9.c	22 Apr 2002 22:33:06 -0000	1.14
@@ -125,9 +125,15 @@
 	case AFMT_U16_BE:
 	    alsa_format = SND_PCM_FORMAT_U16_BE;
 	    break;
+#ifndef WORDS_BIGENDIAN
+	case AFMT_AC3:
+#endif
 	case AFMT_S16_LE:
 	    alsa_format = SND_PCM_FORMAT_S16_LE;
 	    break;
+#ifdef WORDS_BIGENDIAN
+	case AFMT_AC3:
+#endif
 	case AFMT_S16_BE:
 	    alsa_format = SND_PCM_FORMAT_S16_BE;
 	    break;

Index: ao_nas.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_nas.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ao_nas.c	20 Feb 2002 22:45:48 -0000	1.3
+++ ao_nas.c	22 Apr 2002 22:33:06 -0000	1.4
@@ -291,7 +291,13 @@
 	case	AFMT_S8:	return AuFormatLinearSigned8;
 	case	AFMT_U16_LE:	return AuFormatLinearUnsigned16LSB;
 	case	AFMT_U16_BE:	return AuFormatLinearUnsigned16MSB;
+#ifndef WORDS_BIGENDIAN
+	case AFMT_AC3:
+#endif
 	case	AFMT_S16_LE:	return AuFormatLinearSigned16LSB;
+#ifdef WORDS_BIGENDIAN
+	case AFMT_AC3:
+#endif
 	case	AFMT_S16_BE:	return AuFormatLinearSigned16MSB;
 	case	AFMT_MU_LAW:	return AuFormatULAW8;
 	default: return 0;

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ao_oss.c	19 Mar 2002 19:16:01 -0000	1.20
+++ ao_oss.c	22 Apr 2002 22:33:06 -0000	1.21
@@ -123,12 +123,18 @@
     ao_data.samplerate=rate;
     ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate);
   }
-  
+
+ac3_retry:  
   ao_data.format=format;
-  ioctl (audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format);
-  if(format == AFMT_AC3 && ao_data.format != AFMT_AC3) {
-      printf("Can't set audio device %s to AC3 output\n", dsp);
-      return 0;
+  if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format)<0 ||
+      ao_data.format != format) if(format == AFMT_AC3){
+    printf("Can't set audio device %s to AC3 output, trying S16...\n", dsp);
+#ifdef WORDS_BIGENDIAN
+    format=AFMT_S16_BE;
+#else
+    format=AFMT_S16_LE;
+#endif
+    goto ac3_retry;
   }
   printf("audio_setup: sample format: %s (requested: %s)\n",
     audio_out_format_name(ao_data.format), audio_out_format_name(format));




More information about the MPlayer-cvslog mailing list