From 17979ae99228dd0422c26e366d6453663b9664a4 Mon Sep 17 00:00:00 2001 From: iovar Date: Mon, 29 Jan 2007 21:15:32 +0000 Subject: 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 --- recordmydesktop/src/flush_to_ogg.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'recordmydesktop/src/flush_to_ogg.c') 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); } -- cgit v1.2.1