summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/cache_audio.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-01-29 05:49:07 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-01-29 05:49:07 +0000
commit46028c7ea0c7cd37d6c5e6c6196978afc950dce4 (patch)
tree94943bfa739d6611e17584383f84f72ec832b021 /recordmydesktop/src/cache_audio.c
parentc1a890715d4791b75b9512c1d9b02cb691c5de39 (diff)
Added support for compilation with OSS, instead of ALSA.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@267 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/cache_audio.c')
-rw-r--r--recordmydesktop/src/cache_audio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/recordmydesktop/src/cache_audio.c b/recordmydesktop/src/cache_audio.c
index c8a71da..178bb7c 100644
--- a/recordmydesktop/src/cache_audio.c
+++ b/recordmydesktop/src/cache_audio.c
@@ -30,8 +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;
+#endif
pthread_mutex_t smut;
pthread_mutex_init(&smut,NULL);
while((pdata->running)){
@@ -55,10 +57,13 @@ void *CacheSoundBuffer(ProgData *pdata){
//advance the list
pdata->sound_buffer=pdata->sound_buffer->next;
pthread_mutex_unlock(&pdata->sound_buffer_mutex);
-
- fwrite(buff->data,pdata->periodsize*framesize,1,
+#ifdef HAVE_LIBASOUND
+ fwrite(buff->data,1,pdata->periodsize*framesize,
pdata->cache_data->afp);
-
+#else
+ fwrite(buff->data,1,pdata->args.buffsize,
+ pdata->cache_data->afp);
+#endif
pdata->avd-=pdata->periodtime;
© All Rights Reserved