summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-10 13:20:56 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-10 13:20:56 +0000
commit4c3818cc9f244537904e359ed835ae18c93ce314 (patch)
treed97f1db28df01edb48785603a41ef22fa57ca707 /TOOLS
parent07e88fd65fc3b452dc9ac03ee9701adcef2f257d (diff)
downloadmpv-4c3818cc9f244537904e359ed835ae18c93ce314.tar.bz2
mpv-4c3818cc9f244537904e359ed835ae18c93ce314.tar.xz
some more printfs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@753 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/audio-block2.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/TOOLS/audio-block2.c b/TOOLS/audio-block2.c
index c3e29fc4b5..6da0cf46cf 100644
--- a/TOOLS/audio-block2.c
+++ b/TOOLS/audio-block2.c
@@ -1,7 +1,8 @@
// This small util discovers your audio driver's behaviour
-#define OUTBURST 512
+//#define OUTBURST 512
//#define OUTBURST 4096
+#define MAX_OUTBURST 32768
#include <stdio.h>
@@ -24,7 +25,7 @@ unsigned int GetTimer(){
return (tv.tv_sec*1000000+tv.tv_usec);
}
-static unsigned char a_buffer[OUTBURST];
+static unsigned char a_buffer[MAX_OUTBURST];
void inline print_info(int audio_fd){
#if 1
@@ -42,6 +43,7 @@ int main(){
int audio_fd;
char *dsp="/dev/dsp";
unsigned int t0,t1,t2;
+ int outburst;
audio_fd=open(dsp, O_WRONLY);
if(audio_fd<0){
@@ -60,6 +62,7 @@ int main(){
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);
@@ -71,17 +74,19 @@ while(xxx-->0){
struct timeval tv;
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=' ';
+// if(select(audio_fd+1, NULL, &rfds, NULL, &tv)) c=' ';
-// print_info(audio_fd);
+ print_info(audio_fd);
- r=write(audio_fd,a_buffer,OUTBURST);
+ 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
if(r==0) printf("EOF writting to device???\n"); else {
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,outburst,t2-t1);
audio_buffer_size+=r;
}
t1=t2;