diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-10-30 06:09:18 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-10-30 06:09:18 +0000 |
commit | 165b32c9bb99baca19dfe9540fc5276bd41f2df0 (patch) | |
tree | 41a61e10bb7ad09a0eea8f8e8fd26357064745cb /rMD-exp | |
parent | 19bcfae70330dc23f8aa7c5e01a786fd9e7a1e75 (diff) |
string formatting during post-encoding
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@132 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'rMD-exp')
-rw-r--r-- | rMD-exp/src/load_cache.c | 7 | ||||
-rw-r--r-- | rMD-exp/src/recordmydesktop.c | 22 |
2 files changed, 16 insertions, 13 deletions
diff --git a/rMD-exp/src/load_cache.c b/rMD-exp/src/load_cache.c index 9ef75a6..cd09956 100644 --- a/rMD-exp/src/load_cache.c +++ b/rMD-exp/src/load_cache.c @@ -96,9 +96,10 @@ void *LoadCache(void *pdata){ else if(gzread(ifp,frame.header,sizeof(FrameHeader))==sizeof(FrameHeader)){ //sync missing_frames+=frame.header->current_total-(extra_frames+frame.header->frameno); + fprintf(stdout,"\r[%d%%] ", + ((frame.header->frameno+extra_frames)*100)/frames_total); - fprintf(stdout,"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" - "%d of %d",frame.header->frameno+extra_frames,frames_total);fflush(stdout); + fflush(stdout); if( (frame.header->Ynum<=pow(divisor,2)) && (frame.header->Unum<=pow(divisor/2,2)) && (frame.header->Vnum<=pow(divisor/2,2)) && @@ -158,7 +159,7 @@ void *LoadCache(void *pdata){ } } } - + fprintf(stdout,"\n"); CLEAR_FRAME(&frame) free(sound_data); gzclose(ifp); diff --git a/rMD-exp/src/recordmydesktop.c b/rMD-exp/src/recordmydesktop.c index 8bb86f8..68d498d 100644 --- a/rMD-exp/src/recordmydesktop.c +++ b/rMD-exp/src/recordmydesktop.c @@ -71,7 +71,7 @@ int main(int argc,char **argv){ } if(SetBRWindow(pdata.dpy,&pdata.brwin,&pdata.specs,&pdata.args)) exit(11); - + QueryExtensions(pdata.dpy,&pdata.args,&pdata.damage_event, &pdata.damage_error); //init data @@ -89,7 +89,7 @@ int main(int argc,char **argv){ if((pdata.args.noshared)) pdata.datamain=(char *)malloc(pdata.brwin.nbytes); - + if(pdata.args.noshared) pdata.datatemp=(char *)malloc(pdata.brwin.nbytes); pdata.rect_root[0]=pdata.rect_root[1]=NULL; @@ -109,7 +109,7 @@ int main(int argc,char **argv){ time_cond=&pdata.time_cond; pause_cond=&pdata.pause_cond; Running=&pdata.running; - + if((pdata.args.noshared)){ pdata.image=XCreateImage(pdata.dpy, pdata.specs.visual, pdata.specs.depth, ZPixmap, 0,pdata.datamain,pdata.brwin.rgeom.width, pdata.brwin.rgeom.height, 8, 0); @@ -118,7 +118,7 @@ int main(int argc,char **argv){ pdata.brwin.rgeom.width,pdata.brwin.rgeom.height); } if((!pdata.args.noshared)||(!pdata.args.nocondshared)){ - pdata.shimage=XShmCreateImage (pdata.dpy,pdata.specs.visual,pdata.specs.depth,ZPixmap,pdata.datash, + pdata.shimage=XShmCreateImage (pdata.dpy,pdata.specs.visual,pdata.specs.depth,ZPixmap,pdata.datash, &shminfo, pdata.brwin.rgeom.width,pdata.brwin.rgeom.height); shminfo.shmid = shmget (IPC_PRIVATE, pdata.shimage->bytes_per_line * pdata.shimage->height, @@ -138,7 +138,7 @@ int main(int argc,char **argv){ exit(3); } } - + if(pdata.args.encOnTheFly) InitEncoder(&pdata,&enc_data,0); else @@ -200,13 +200,13 @@ int main(int argc,char **argv){ } if(pdata.args.encOnTheFly) pthread_create(&flush_to_ogg_t,NULL,FlushToOgg,(void *)&pdata); - + RegisterCallbacks(&pdata.args); fprintf(stderr,"Capturing!\n"); //wait all threads to finish - + pthread_join(image_capture_t,NULL); fprintf(stderr,"Shutting down."); //if no damage events have been received the thread will get stuck @@ -246,7 +246,7 @@ int main(int argc,char **argv){ if(pdata.args.encOnTheFly) pthread_join(flush_to_ogg_t,NULL); fprintf(stderr,"."); - + if(!pdata.args.full_shots) pthread_join(poll_damage_t,NULL); @@ -258,7 +258,7 @@ int main(int argc,char **argv){ shmctl (shminfo.shmid, IPC_RMID, 0); } fprintf(stderr,"\n"); - + //Now that we are done with recording we cancel the timer CancelTimer(); @@ -266,7 +266,9 @@ int main(int argc,char **argv){ /** Encoding */ if(!pdata.args.encOnTheFly){ if(!Aborted){ - fprintf(stderr,"Encoding started!\nPlease wait...\n"); + fprintf(stderr,"Encoding started!\nThis may take several minutes.\n" + "Pressing Ctrl-C will cancel the procedure (files we be permanetly deleted).\n" + "Please wait...\n"); pdata.running=1; InitEncoder(&pdata,&enc_data,1); //load encoding and flushing threads |