diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-01-29 21:15:32 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-01-29 21:15:32 +0000 |
commit | 17979ae99228dd0422c26e366d6453663b9664a4 (patch) | |
tree | 589dc742d8fbfdbdd034517dbbccc0e290789047 /recordmydesktop/src/flush_to_ogg.c | |
parent | 6ddb091a949d1c7ef107307aedf980bc34f6aa57 (diff) |
Fixed all condition variables, to be waited with correct mutexes.
This fixed also the wakeup from pause bug.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@269 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/flush_to_ogg.c')
-rw-r--r-- | recordmydesktop/src/flush_to_ogg.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/recordmydesktop/src/flush_to_ogg.c b/recordmydesktop/src/flush_to_ogg.c index cc00708..b8d1625 100644 --- a/recordmydesktop/src/flush_to_ogg.c +++ b/recordmydesktop/src/flush_to_ogg.c @@ -66,9 +66,6 @@ void *FlushToOgg(ProgData *pdata){ double audiotime=0; double videotime=0; - pthread_mutex_t imut,vmut; - pthread_mutex_init(&imut,NULL); - pthread_mutex_init(&vmut,NULL); int working=1, th_st_fin=0, v_st_fin=(pdata->args.nosound); @@ -108,7 +105,10 @@ void *FlushToOgg(ProgData *pdata){ //we need the last page to properly close the stream if(!videoflag){ if(!pdata->th_encoding_clean){ - pthread_cond_wait(&pdata->theora_lib_clean,&imut); + pthread_mutex_lock(&pdata->theora_lib_mutex); + pthread_cond_wait(&pdata->theora_lib_clean, + &pdata->theora_lib_mutex); + pthread_mutex_unlock(&pdata->theora_lib_mutex); } SyncEncodeImageBuffer(pdata); } @@ -125,7 +125,10 @@ void *FlushToOgg(ProgData *pdata){ //we need the last page to properly close the stream if(!audioflag){ if(!pdata->v_encoding_clean){ - pthread_cond_wait(&pdata->vorbis_lib_clean,&vmut); + pthread_mutex_lock(&pdata->vorbis_lib_mutex); + pthread_cond_wait(&pdata->vorbis_lib_clean, + &pdata->vorbis_lib_mutex); + pthread_mutex_unlock(&pdata->vorbis_lib_mutex); } SyncEncodeSoundBuffer(pdata,NULL); } |