summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/capture_sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'recordmydesktop/src/capture_sound.c')
-rw-r--r--recordmydesktop/src/capture_sound.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c
index 0e89e21..c89909e 100644
--- a/recordmydesktop/src/capture_sound.c
+++ b/recordmydesktop/src/capture_sound.c
@@ -31,8 +31,6 @@ void *CaptureSound(ProgData *pdata){
#ifdef HAVE_LIBASOUND
int frames=pdata->periodsize;
- int framesize=((snd_pcm_format_width(SND_PCM_FORMAT_S16_LE))/8)*
- pdata->args.channels;
#endif
//start capturing only after first frame is taken
usleep(pdata->frametime);
@@ -92,7 +90,7 @@ void *CaptureSound(ProgData *pdata){
//create new buffer
newbuf=(SndBuffer *)malloc(sizeof(SndBuffer));
#ifdef HAVE_LIBASOUND
- newbuf->data=(signed char *)malloc(frames*framesize);
+ newbuf->data=(signed char *)malloc(frames*pdata->sound_framesize);
#else
newbuf->data=(signed char *)malloc(((pdata->args.buffsize<<1)*
pdata->args.channels));
@@ -103,7 +101,7 @@ void *CaptureSound(ProgData *pdata){
#ifdef HAVE_LIBASOUND
while(sret<frames){
int temp_sret=snd_pcm_readi(pdata->sound_handle,
- newbuf->data+framesize*sret,
+ newbuf->data+pdata->sound_framesize*sret,
frames-sret);
if(temp_sret==-EPIPE){
fprintf(stderr,"%s: Overrun occurred.\n",
© All Rights Reserved