[Mplayer-cvslog] CVS: main/TOOLS audio-block2.c,1.3,1.4

GEREOFFY arpi_esp at users.sourceforge.net
Thu May 10 15:20:58 CEST 2001


Update of /cvsroot/mplayer/main/TOOLS
In directory usw-pr-cvs1:/tmp/cvs-serv9018

Modified Files:
	audio-block2.c 
Log Message:
some more printfs

Index: audio-block2.c
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/audio-block2.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** audio-block2.c	2001/05/10 03:39:54	1.3
--- audio-block2.c	2001/05/10 13:20:56	1.4
***************
*** 1,6 ****
  // This small util discovers your audio driver's behaviour
  
! #define OUTBURST 512
  //#define OUTBURST 4096
  
  
--- 1,7 ----
  // This small util discovers your audio driver's behaviour
  
! //#define OUTBURST 512
  //#define OUTBURST 4096
+ #define MAX_OUTBURST 32768
  
  
***************
*** 25,29 ****
  }  
  
! static unsigned char a_buffer[OUTBURST];
  
  void inline print_info(int audio_fd){
--- 26,30 ----
  }  
  
! static unsigned char a_buffer[MAX_OUTBURST];
  
  void inline print_info(int audio_fd){
***************
*** 43,46 ****
--- 44,48 ----
    char *dsp="/dev/dsp";
    unsigned int t0,t1,t2;
+   int outburst;
  
    audio_fd=open(dsp, O_WRONLY);
***************
*** 61,64 ****
--- 63,67 ----
    r=0; ioctl (audio_fd, SNDCTL_DSP_GETBLKSIZE, &r);
    printf("fragment size = %d\n",r);
+   outburst=r; if(outburst>4096) outburst=4096;
  
    print_info(audio_fd);
***************
*** 72,80 ****
        FD_ZERO(&rfds); FD_SET(audio_fd,&rfds);
        tv.tv_sec=0; tv.tv_usec = 0;
!       if(select(audio_fd+1, NULL, &rfds, NULL, &tv)) c=' ';
  
! //    print_info(audio_fd);
  
!     r=write(audio_fd,a_buffer,OUTBURST);
      t2=GetTimer();
      if(r<0) printf("Error writting to device\n"); else
--- 75,85 ----
        FD_ZERO(&rfds); FD_SET(audio_fd,&rfds);
        tv.tv_sec=0; tv.tv_usec = 0;
! //      if(select(audio_fd+1, NULL, &rfds, NULL, &tv)) c=' ';
  
!     print_info(audio_fd);
  
!     r=0; ioctl (audio_fd, SNDCTL_DSP_GETODELAY, &r); printf("delay = %d\n",r);
! 
!     r=write(audio_fd,a_buffer,outburst);
      t2=GetTimer();
      if(r<0) printf("Error writting to device\n"); else
***************
*** 82,86 ****
        printf("%c %6.3f %6.3f  [%6d] writting %3d of %3d bytes in %7d us\n",c,
          (float)audio_buffer_size/(44100.0f*4.0f),(float)(t1-t0)*0.000001f,
!         audio_buffer_size,r,OUTBURST,t2-t1);
        audio_buffer_size+=r;
      }
--- 87,91 ----
        printf("%c %6.3f %6.3f  [%6d] writting %3d of %3d bytes in %7d us\n",c,
          (float)audio_buffer_size/(44100.0f*4.0f),(float)(t1-t0)*0.000001f,
!         audio_buffer_size,r,outburst,t2-t1);
        audio_buffer_size+=r;
      }


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list