summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/capture_sound.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-12-13 14:53:02 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-12-13 14:53:02 +0000
commitbfc243a25074f519b994bb34143dc211961ccae0 (patch)
treebd39cbd75e70793b44f12bc43ac6130e7b11ca6f /recordmydesktop/src/capture_sound.c
parentdaac9c24a44eac7ba0a7ec292ee05117e06947bb (diff)
doc/recordmydesktop.1: added documentation about -restore option
include/rmdfunc.h: read and write specs file function protorypes include/rmdtypes.h, src/cache_audio.c src/capture_sound.c, src/encode_sound_buffer.c, src/initialize_data.c, src/load_cache.c: framesize moved to pdata struct(used to be initialized separately by every function that used it). src/Makefile.am: added src/rmd_restore.c src/parseargs.c: handle -restore option src/recordmydesktop.c: argument parsing moved before any X calls (restore doesn't need a running X server) src/rmd_restore.c: initialize all needed structs and data, for restore to be performed. Then EncodeCache routine and exit. src/specsfile.c: read and write specs file function bodies git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@474 f606c939-3180-4ac9-a4b8-4b8779d57d0a
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