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/rmdthreads.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'recordmydesktop/src/rmdthreads.c') diff --git a/recordmydesktop/src/rmdthreads.c b/recordmydesktop/src/rmdthreads.c index 442c67e..4199472 100644 --- a/recordmydesktop/src/rmdthreads.c +++ b/recordmydesktop/src/rmdthreads.c @@ -96,7 +96,9 @@ void rmdThreads(ProgData *pdata){ //if no damage events have been received the thread will get stuck while(!pdata->th_enc_thread_waiting && !pdata->th_encoding_clean){ usleep(10000); + pthread_mutex_lock(&pdata->img_buff_ready_mutex); pthread_cond_signal(&pdata->image_buffer_ready); + pthread_mutex_unlock(&pdata->img_buff_ready_mutex); } if(pdata->args.encOnTheFly){ @@ -110,7 +112,9 @@ void rmdThreads(ProgData *pdata){ fprintf(stderr,"."); while(!pdata->v_enc_thread_waiting && !pdata->v_encoding_clean){ usleep(10000); + pthread_mutex_lock(&pdata->snd_buff_ready_mutex); pthread_cond_signal(&pdata->sound_data_read); + pthread_mutex_unlock(&pdata->snd_buff_ready_mutex); } if(pdata->args.encOnTheFly){ pthread_join(sound_encode_t,NULL); -- cgit v1.2.3