[xiph-cvs] cvs commit: snatch libsnatch.c

Monty xiphmont at xiph.org
Fri Nov 9 23:21:43 PST 2001



xiphmont    01/11/09 23:21:42

  Modified:    .        libsnatch.c
  Log:
  Must properly fake SNDCTL_DSP_GETOSPACE ioctl() on older/Intel version of RP8

Revision  Changes    Path
1.11      +44 -33    snatch/libsnatch.c

Index: libsnatch.c
===================================================================
RCS file: /usr/local/cvsroot/snatch/libsnatch.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- libsnatch.c	2001/11/10 06:50:43	1.10
+++ libsnatch.c	2001/11/10 07:21:42	1.11
@@ -553,53 +553,64 @@
   va_end(optional);
   
   if(fd==audio_fd){
-      fprintf(stderr,"ioctl %lx ",rq);
-      
+
     if(rq==SNDCTL_DSP_SPEED ||
        rq==SNDCTL_DSP_CHANNELS ||
        rq==SNDCTL_DSP_GETODELAY ||
+       rq==SNDCTL_DSP_GETOSPACE ||
        rq==SNDCTL_DSP_SETFMT){
 
       if(!fake_audiop)
         ret=(*libc_ioctl)(fd,rq,arg);
 
-      if(ret==0  || rq==SNDCTL_DSP_GETODELAY){
-	switch(rq){
-	case SNDCTL_DSP_SPEED:
-	  audio_rate=*(int *)arg;
-	  if(debug)
-	    fprintf(stderr,
-		    "    ...: Audio output sampling rate set to %dHz.\n",
+      switch(rq){
+      case SNDCTL_DSP_SPEED:
+	audio_rate=*(int *)arg;
+	if(debug)
+	  fprintf(stderr,
+		  "    ...: Audio output sampling rate set to %dHz.\n",
                     audio_rate);
-	  break;
-	case SNDCTL_DSP_CHANNELS:
-	  audio_channels=*(int *)arg;
+	break;
+      case SNDCTL_DSP_CHANNELS:
+	audio_channels=*(int *)arg;
+	if(debug)
+	  fprintf(stderr,
+		  "    ...: Audio output set to %d channels.\n",
+		  audio_channels);
+	break;
+      case SNDCTL_DSP_SETFMT:
+	audio_format=*(int *)arg;
+	if(debug)
+	  fprintf(stderr,
+		  "    ...: Audio output format set to %s.\n",
+		  formatname(audio_format));
+	break;
+      case SNDCTL_DSP_GETOSPACE:
+	if(fake_audiop){
+	  audio_buf_info *temp=arg;
+	  temp->fragments=32;
+	  temp->fragstotal=32;
+	  temp->fragsize=2048;
+	  temp->bytes=64*1024;
+
           if(debug)
-	    fprintf(stderr,
-		    "    ...: Audio output set to %d channels.\n",
-		    audio_channels);
-	  break;
-	case SNDCTL_DSP_SETFMT:
-	  audio_format=*(int *)arg;
+	    fprintf(stderr,"    ...: Audio output buffer size requested; faking 64k\n");
+	  ret=0;
+	}
+	break;
+      case SNDCTL_DSP_GETODELAY: /* Must reject the ODELAY if we're not going to track 
+				    audio bytes and timing! */
+	if(fake_audiop){
+	  int foo=*(int *)arg;
           if(debug)
             fprintf(stderr,
-		    "    ...: Audio output format set to %s.\n",
-		    formatname(audio_format));
-	  break;
-	case SNDCTL_DSP_GETODELAY: /* Must reject the ODELAY if we're not going to track 
-				      audio bytes and timing! */
-	  {
-	    int foo=*(int *)arg;
-	    if(debug)
-	      fprintf(stderr,
-		      "    ...: Audio output delay returned %d %d.\n",
-		      ret,foo);
-	    *(int *)arg=0;
-	    ret=-1;
-	  }
-	  break;
+		    "    ...: Rejecting SNDCTL_DSP_GETODELAY ioctl()\n");
+	  *(int *)arg=0;
+	  ret=-1;
         }
+	break;
       }
+    
       return(ret);
     }else
       if(fake_audiop)return(0);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list