[Mplayer-cvslog] CVS: main/libao2 ao_oss.c,1.22,1.23

Arpi of Ize arpi at mplayerhq.hu
Mon Apr 29 22:42:18 CEST 2002


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

Modified Files:
	ao_oss.c 
Log Message:
nonblock open is not legal for OSS (see OSS api docs), and causes problems on freebsd (and maybe other OSs)

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ao_oss.c	27 Apr 2002 22:42:24 -0000	1.22
+++ ao_oss.c	29 Apr 2002 20:42:15 -0000	1.23
@@ -103,17 +103,23 @@
   if (verbose)
     printf("audio_setup: using '%s' dsp device\n", dsp);
 
+#ifdef __linux__
   audio_fd=open(dsp, O_WRONLY | O_NONBLOCK);
+#else
+  audio_fd=open(dsp, O_WRONLY);
+#endif
   if(audio_fd<0){
     printf("Can't open audio device %s: %s  -> no sound\n", dsp, strerror(errno));
     return 0;
   }
 
+#ifdef __linux__
   /* Remove the non-blocking flag */
   if(fcntl(audio_fd, F_SETFL, 0) < 0) {
    printf("Can't make filedescriptor non-blocking: %s -> no sound\n", strerror(errno));
    return 0;
   }  
+#endif
   
   ao_data.bps=channels*rate;
   if(format != AFMT_U8 && format != AFMT_S8)
@@ -217,8 +223,13 @@
 // stop playing and empty buffers (for seeking/pause)
 static void reset(){
     uninit();
+#ifdef __linux__
     audio_fd=open(dsp, O_WRONLY | O_NONBLOCK);
     if(audio_fd < 0 || fcntl(audio_fd, F_SETFL, 0) < 0){
+#else
+    audio_fd=open(dsp, O_WRONLY);
+    if(audio_fd < 0){
+#endif
 	printf("\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n", strerror(errno));
 	return;
     }




More information about the MPlayer-cvslog mailing list