From 5076dbf5c8974316119d6bad42c413a3e3bf5ec9 Mon Sep 17 00:00:00 2001 From: iovar Date: Sat, 28 Oct 2006 15:14:57 +0000 Subject: mostly changes on cache writting/loading/encoding,which is now functional.Also var other minor changes git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@124 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- rMD-exp/src/recordmydesktop.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'rMD-exp/src/recordmydesktop.c') diff --git a/rMD-exp/src/recordmydesktop.c b/rMD-exp/src/recordmydesktop.c index a90a953..8bb86f8 100644 --- a/rMD-exp/src/recordmydesktop.c +++ b/rMD-exp/src/recordmydesktop.c @@ -247,11 +247,9 @@ int main(int argc,char **argv){ pthread_join(flush_to_ogg_t,NULL); fprintf(stderr,"."); - //this thread will get cancelled instead of joined - //this is neccessary to terminate the application, if for some reason - //damage events are not delivered(i.e comp windopw managers) if(!pdata.args.full_shots) - pthread_cancel(poll_damage_t); + pthread_join(poll_damage_t,NULL); + fprintf(stderr,"."); if((!pdata.args.noshared)||(!pdata.args.nocondshared)){ @@ -262,16 +260,16 @@ int main(int argc,char **argv){ fprintf(stderr,"\n"); - + //Now that we are done with recording we cancel the timer + CancelTimer(); /** Encoding */ if(!pdata.args.encOnTheFly){ if(!Aborted){ - + fprintf(stderr,"Encoding started!\nPlease wait...\n"); pdata.running=1; InitEncoder(&pdata,&enc_data,1); //load encoding and flushing threads - pthread_create(&image_encode_t,NULL,EncodeImageBuffer,(void *)&pdata); if(!pdata.args.nosound){ //before we start loading again //we need to free any left-overs @@ -279,8 +277,6 @@ int main(int argc,char **argv){ free(pdata.sound_buffer->data); pdata.sound_buffer=pdata.sound_buffer->next; } - pthread_create(&sound_encode_t,NULL,EncodeSoundBuffer,(void *)&pdata); - } pthread_create(&flush_to_ogg_t,NULL,FlushToOgg,(void *)&pdata); @@ -288,32 +284,17 @@ int main(int argc,char **argv){ //start loading image and audio pthread_create(&load_cache_t,NULL,LoadCache,(void *)&pdata); - - //call loading func{ - //if avd>=0 - //load image from cache - //signal buffer - ////if avd<0 - //load sound from cache - //signal buffer - //} - //join and finish - pthread_join(load_cache_t,NULL); - pthread_cond_broadcast(&pdata.image_buffer_ready); - pthread_join(image_encode_t,NULL); - if(!pdata.args.nosound) - pthread_join(sound_encode_t,NULL); - + fprintf(stderr,"Encoding finished!\nWait a moment please...\n"); + pthread_join(flush_to_ogg_t,NULL); + fprintf(stderr,"Done!!!\n"); } - //clean-up data } /**@_______________________________________________@*/ //This can happen earlier, but in some cases it might get stuck. //So we must make sure the recording is not wasted. - XFlush(pdata.dpy); XCloseDisplay(pdata.dpy); if(Aborted){ -- cgit v1.2.3