[Mplayer-cvslog] CVS: main/libao2 ao_oss.c,1.8,1.9 audio_out.c,1.11,1.12

Arpi of Ize arpi at mplayer.dev.hu
Wed Aug 15 13:47:27 CEST 2001


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

Modified Files:
	ao_oss.c audio_out.c 
Log Message:
ac3/spdif patch by German Gomez Garcia <german at piraos.com>

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ao_oss.c	6 Aug 2001 23:59:49 -0000	1.8
+++ ao_oss.c	15 Aug 2001 11:47:25 -0000	1.9
@@ -55,6 +55,9 @@
 	{
 	    ao_control_vol_t *vol = (ao_control_vol_t *)arg;
 	    int fd, v, mcmd, devs;
+
+	    if(ao_format == AFMT_AC3)
+		return CONTROL_TRUE;
     
 	    if ((fd = open("/dev/mixer", O_RDONLY)) > 0)
 	    {
@@ -119,9 +122,14 @@
 
   ao_format=format;
   ioctl (audio_fd, SNDCTL_DSP_SETFMT, &ao_format);
+  if(format == AFMT_AC3 && ao_format != AFMT_AC3) {
+      printf("Can't set audio device %s to AC3 output\n", dsp);
+      return 0;
+  }
   printf("audio_setup: sample format: %s (requested: %s)\n",
     audio_out_format_name(ao_format), audio_out_format_name(format));
   
+  if(format != AFMT_AC3) {
   ao_channels=channels-1;
   ioctl (audio_fd, SNDCTL_DSP_STEREO, &ao_channels);
   
@@ -129,6 +137,7 @@
   ao_samplerate=rate;
   ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_samplerate);
   printf("audio_setup: using %d Hz samplerate (requested: %d)\n",ao_samplerate,rate);
+  }
 
   if(ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &zz)==-1){
       int r=0;
@@ -191,9 +200,10 @@
     }
 
   ioctl (audio_fd, SNDCTL_DSP_SETFMT, &ao_format);
+  if(ao_format != AFMT_AC3) {
   ioctl (audio_fd, SNDCTL_DSP_STEREO, &ao_channels);
   ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_samplerate);
-
+  }
 }
 
 // stop playing, keep buffers (for pause)

Index: audio_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/audio_out.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- audio_out.c	21 Jun 2001 22:34:58 -0000	1.11
+++ audio_out.c	15 Aug 2001 11:47:25 -0000	1.12
@@ -87,6 +87,8 @@
 	    return("Unsigned 16-bit (Big-Endian)");
 	case AFMT_MPEG:
 	    return("MPEG (2) audio");
+	case AFMT_AC3:
+	    return("AC3");
 /*
   the following two formats are not available with old linux kernel
   headers (e.g. in 2.2.16)




More information about the MPlayer-cvslog mailing list