diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-12-15 19:24:18 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-12-15 19:24:18 +0000 |
commit | efaabd37eab44ac9f056811296552f469bb9fe74 (patch) | |
tree | 6ffe8468e0e996d6b3c3833c166e17c7e2ef70a5 /recordmydesktop/src | |
parent | 032222eaf85ff3514bdd0f531bcc82bfee41b124 (diff) |
made sure that sound capture will wait for the first
time expiration,before it starts(wait on cond_var before loop).
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@238 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r-- | recordmydesktop/src/capture_sound.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c index ef65bbc..5ba27f7 100644 --- a/recordmydesktop/src/capture_sound.c +++ b/recordmydesktop/src/capture_sound.c @@ -31,9 +31,13 @@ void *CaptureSound(ProgData *pdata){ int frames=pdata->periodsize; int framesize=((snd_pcm_format_width(SND_PCM_FORMAT_S16_LE))/8)*pdata->args.channels; - pthread_mutex_t pmut; + pthread_mutex_t pmut,tmut; pthread_mutex_init(&pmut,NULL); + pthread_mutex_init(&tmut,NULL); + //start capturing only when everything else is finsihed + //ideally, at the same time that the first frame is captured + pthread_cond_wait(&pdata->time_cond,&tmut); while(pdata->running){ int sret=0; SndBuffer *newbuf,*tmp; |