From ef155ccbd15bdfca39b755dd8194854422f854e4 Mon Sep 17 00:00:00 2001 From: iovar Date: Thu, 26 Oct 2006 06:28:03 +0000 Subject: made sure compositing managers don't cause a hang git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@121 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- rMD-exp/src/cache_frame.c | 2 +- rMD-exp/src/poll_damage.c | 2 +- rMD-exp/src/recordmydesktop.c | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'rMD-exp/src') diff --git a/rMD-exp/src/cache_frame.c b/rMD-exp/src/cache_frame.c index 6f97723..8a1e0ca 100644 --- a/rMD-exp/src/cache_frame.c +++ b/rMD-exp/src/cache_frame.c @@ -189,7 +189,7 @@ void *CacheImageBuffer(void *pdata){ free(yuv[i].u); free(yuv[i].v); } - fprintf(stderr,"Saved %d frames in a total of %d requests",frameno,frames_total); +// fprintf(stderr,"Saved %d frames in a total of %d requests",frameno,frames_total); gzclose(fp); pthread_exit(&errno); } diff --git a/rMD-exp/src/poll_damage.c b/rMD-exp/src/poll_damage.c index 5433bbc..73742f5 100644 --- a/rMD-exp/src/poll_damage.c +++ b/rMD-exp/src/poll_damage.c @@ -31,7 +31,7 @@ void *PollDamage(void *pdata){ Damage damage; XEvent event; - int inserts=0; + inserts=0; damage= XDamageCreate( ((ProgData *)pdata)->dpy, ((ProgData *)pdata)->brwin.windowid, XDamageReportRawRectangles); diff --git a/rMD-exp/src/recordmydesktop.c b/rMD-exp/src/recordmydesktop.c index c6b059a..24037ce 100644 --- a/rMD-exp/src/recordmydesktop.c +++ b/rMD-exp/src/recordmydesktop.c @@ -208,6 +208,8 @@ int main(int argc,char **argv){ pthread_join(image_capture_t,NULL); fprintf(stderr,"Shutting down."); + //if no damage events have been received the thread will get stuck + pthread_cond_broadcast(&pdata.image_buffer_ready); if(pdata.args.encOnTheFly) pthread_join(image_encode_t,NULL); else @@ -257,7 +259,10 @@ int main(int argc,char **argv){ shmctl (shminfo.shmid, IPC_RMID, 0); } fprintf(stderr,"\n"); - XCloseDisplay(pdata.dpy); + + if(pdata.args.full_shots || inserts!=1)//otherwise it will hang + XCloseDisplay(pdata.dpy); + /** Encoding */ -- cgit v1.2.3