diff options
author | biocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-07-29 12:03:35 +0000 |
---|---|---|
committer | biocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-07-29 12:03:35 +0000 |
commit | e89b002f4a18baa57763cf7581b5453f11b3a23f (patch) | |
tree | 1660dc16b5f618b86d2c8a3f7da429e9ee349bd6 /recordmydesktop/src | |
parent | c829785fb6172fc776788a27ab3f75ee6bdca290 (diff) |
*** empty log message ***
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@32 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r-- | recordmydesktop/src/capture_sound.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c index 5dc3839..a8b3846 100644 --- a/recordmydesktop/src/capture_sound.c +++ b/recordmydesktop/src/capture_sound.c @@ -70,16 +70,17 @@ void *CaptureSound(void *pdata){ //read data into new buffer while(sret<frames){ - int tsret=snd_pcm_readi(((ProgData *)pdata)->sound_handle, + int temp_sret=snd_pcm_readi(((ProgData *)pdata)->sound_handle, newbuf->data+2*((ProgData *)pdata)->args.channels*sret, frames-sret); - if(tsret==-EPIPE) + if(temp_sret==-EPIPE) + snd_pcm_prepare(((ProgData *)pdata)->sound_handle); + else if (temp_sret<0){ + fprintf(stderr,"An error occured while reading sound data:\n %s\n",snd_strerror(temp_sret)); snd_pcm_prepare(((ProgData *)pdata)->sound_handle); - else if (tsret<0){ - fprintf(stderr,"An error occured while reading sound data:\n %s\n",snd_strerror(sret)); } else - sret+=tsret; + sret+=temp_sret; } //queue the new buffer |