summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmd_cache_frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'recordmydesktop/src/rmd_cache_frame.c')
-rw-r--r--recordmydesktop/src/rmd_cache_frame.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/recordmydesktop/src/rmd_cache_frame.c b/recordmydesktop/src/rmd_cache_frame.c
index 3c4c219..0747f7d 100644
--- a/recordmydesktop/src/rmd_cache_frame.c
+++ b/recordmydesktop/src/rmd_cache_frame.c
@@ -102,7 +102,7 @@ void *rmdCacheImageBuffer(ProgData *pdata) {
y_short_blocks[blocknum_x*blocknum_y],
u_short_blocks[blocknum_x*blocknum_y],
v_short_blocks[blocknum_x*blocknum_y];
- unsigned long long int total_bytes = 0;
+ unsigned long long int total_bytes = 0;
unsigned long long int total_received_bytes = 0;
if (!pdata->args.zerocompression) {
@@ -123,17 +123,16 @@ void *rmdCacheImageBuffer(ProgData *pdata) {
FrameHeader fheader;
ynum=unum=vnum=0;
- pdata->th_enc_thread_waiting=1;
pthread_mutex_lock(&pdata->img_buff_ready_mutex);
- pthread_cond_wait(&pdata->image_buffer_ready, &pdata->img_buff_ready_mutex);
+ pdata->th_enc_thread_waiting = 1;
+ while (pdata->th_enc_thread_waiting)
+ pthread_cond_wait(&pdata->image_buffer_ready, &pdata->img_buff_ready_mutex);
pthread_mutex_unlock(&pdata->img_buff_ready_mutex);
- pdata->th_enc_thread_waiting=0;
- if (pdata->paused) {
- pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ while (pdata->paused)
pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
- pthread_mutex_unlock(&pdata->pause_mutex);
- }
+ pthread_mutex_unlock(&pdata->pause_mutex);
pthread_mutex_lock(&pdata->yuv_mutex);
© All Rights Reserved