From bfc243a25074f519b994bb34143dc211961ccae0 Mon Sep 17 00:00:00 2001 From: iovar Date: Thu, 13 Dec 2007 14:53:02 +0000 Subject: 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 --- recordmydesktop/src/cache_audio.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'recordmydesktop/src/cache_audio.c') diff --git a/recordmydesktop/src/cache_audio.c b/recordmydesktop/src/cache_audio.c index 7896df7..d45e6ec 100644 --- a/recordmydesktop/src/cache_audio.c +++ b/recordmydesktop/src/cache_audio.c @@ -30,18 +30,10 @@ void *CacheSoundBuffer(ProgData *pdata){ //It's sound is tiny compared to that of image, so //compressing would reducethe overall size by only an //insignificant fraction. -#ifdef HAVE_LIBASOUND - int framesize=((snd_pcm_format_width(SND_PCM_FORMAT_S16_LE))/8)* - pdata->args.channels; -#else - int framesize=pdata->args.channels<<1;//Always signed 16 bit data -#endif #ifdef HAVE_JACK_H void *jackbuf=NULL; if(pdata->args.use_jack){ - framesize=sizeof(jack_default_audio_sample_t)* - pdata->jdata->nports; - jackbuf=malloc(framesize*pdata->jdata->buffersize); + jackbuf=malloc(pdata->sound_framesize*pdata->jdata->buffersize); } #endif while((pdata->running)){ @@ -69,7 +61,7 @@ void *CacheSoundBuffer(ProgData *pdata){ //advance the list pdata->sound_buffer=pdata->sound_buffer->next; pthread_mutex_unlock(&pdata->sound_buffer_mutex); - fwrite(buff->data,1,pdata->periodsize*framesize, + fwrite(buff->data,1,pdata->periodsize*pdata->sound_framesize, pdata->cache_data->afp); free(buff->data); free(buff); @@ -77,11 +69,13 @@ void *CacheSoundBuffer(ProgData *pdata){ else{ #ifdef HAVE_JACK_H if((*jack_ringbuffer_read_space_p)(pdata->jdata->sound_buffer)>= - (framesize*pdata->jdata->buffersize)){ + (pdata->sound_framesize*pdata->jdata->buffersize)){ (*jack_ringbuffer_read_p)(pdata->jdata->sound_buffer, jackbuf, - (framesize*pdata->jdata->buffersize)); - fwrite(jackbuf,1,(framesize*pdata->jdata->buffersize), + (pdata->sound_framesize* + pdata->jdata->buffersize)); + fwrite(jackbuf,1,(pdata->sound_framesize* + pdata->jdata->buffersize), pdata->cache_data->afp); } else{ -- cgit v1.2.1