diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-05-08 21:28:04 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-05-08 21:28:04 +0000 |
commit | 6364e83c9f4ad17a4ce1210dcc4cc77caa36cc47 (patch) | |
tree | cc10ddc4975c3d670ed4b4522e5d39a592328f7b /TOOLS | |
parent | ff4897b64ad20bc1efd4d97eea181315a77e0ca4 (diff) |
fragment info added (disabled)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@731 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r-- | TOOLS/audio-block2.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/TOOLS/audio-block2.c b/TOOLS/audio-block2.c index 9720d2af0a..3480083686 100644 --- a/TOOLS/audio-block2.c +++ b/TOOLS/audio-block2.c @@ -26,6 +26,15 @@ unsigned int GetTimer(){ static unsigned char a_buffer[OUTBURST]; +void inline print_info(int audio_fd){ +#if 1 + audio_buf_info zz; + ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &zz); + printf("Status: %3d/%d (%d byte/frag) free: %6d\n", + zz.fragments, zz.fragstotal, zz.fragsize, zz.bytes); +#endif +} + int main(){ int audio_buffer_size=0; int r; @@ -39,12 +48,19 @@ int main(){ printf("Can't open audio device %s\n",dsp); return 1; } + +// ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); +// print_info(audio_fd); + + ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); r=AFMT_S16_LE;ioctl (audio_fd, SNDCTL_DSP_SETFMT, &r); r=1; ioctl (audio_fd, SNDCTL_DSP_STEREO, &r); r=44100; if(ioctl (audio_fd, SNDCTL_DSP_SPEED, &r)==-1) printf("audio_setup: your card doesn't support %d Hz samplerate\n",r); +// print_info(audio_fd); + t0=t1=GetTimer(); while(xxx-->0){ @@ -55,6 +71,8 @@ while(xxx-->0){ 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 |