diff options
-rw-r--r-- | recordmydesktop/src/rmd_capture_sound.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/recordmydesktop/src/rmd_capture_sound.c b/recordmydesktop/src/rmd_capture_sound.c index 2d02aee..63c46f3 100644 --- a/recordmydesktop/src/rmd_capture_sound.c +++ b/recordmydesktop/src/rmd_capture_sound.c @@ -144,22 +144,17 @@ void *rmdCaptureSound(ProgData *pdata) { #endif //queue the new buffer pthread_mutex_lock(&pdata->sound_buffer_mutex); - tmp=pdata->sound_buffer; - if (pdata->sound_buffer==NULL) - pdata->sound_buffer=newbuf; + tmp = pdata->sound_buffer; + if (!tmp) + pdata->sound_buffer = newbuf; else { - while (tmp->next!=NULL) - tmp=tmp->next; + while (tmp->next != NULL) + tmp = tmp->next; - tmp->next=newbuf; + tmp->next = newbuf; } - pthread_mutex_unlock(&pdata->sound_buffer_mutex); - - - //signal that there are data to be proccessed - pthread_mutex_lock(&pdata->snd_buff_ready_mutex); pthread_cond_signal(&pdata->sound_data_read); - pthread_mutex_unlock(&pdata->snd_buff_ready_mutex); + pthread_mutex_unlock(&pdata->sound_buffer_mutex); } #ifdef HAVE_LIBASOUND snd_pcm_close(pdata->sound_handle); |