diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-07-08 15:33:33 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-07-08 15:33:33 +0000 |
commit | 5de377e1c1a21e8b08758b8938cb30ce3aec7c2e (patch) | |
tree | 9c239d73ddbed4b19c5d4f5a9848e441e96ad20d /recordmydesktop | |
parent | 80f8810b4eb1fe61dad842b197e410eb5ded5f1d (diff) |
recordmydesktop.c: added initialization for cache block arrays.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@372 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop')
-rw-r--r-- | recordmydesktop/src/recordmydesktop.c | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/recordmydesktop/src/recordmydesktop.c b/recordmydesktop/src/recordmydesktop.c index b92e934..d2673a7 100644 --- a/recordmydesktop/src/recordmydesktop.c +++ b/recordmydesktop/src/recordmydesktop.c @@ -99,45 +99,57 @@ int main(int argc,char **argv){ &pdata.shm_opcode); - if((exit_status=InitializeData(&pdata,&enc_data,&cache_data))!=0) - return exit_status; + if((exit_status=InitializeData(&pdata,&enc_data,&cache_data))==0){ - //this is where the capturing happens. - rmdThreads(&pdata); + u_int32_t y_t[(pdata.enc_data->yuv.y_width/Y_UNIT_WIDTH)* + (pdata.enc_data->yuv.y_height/Y_UNIT_WIDTH)], + u_t[(pdata.enc_data->yuv.y_width/Y_UNIT_WIDTH)* + (pdata.enc_data->yuv.y_height/Y_UNIT_WIDTH)], + v_t[(pdata.enc_data->yuv.y_width/Y_UNIT_WIDTH)* + (pdata.enc_data->yuv.y_height/Y_UNIT_WIDTH)]; + yblocks=y_t; + ublocks=u_t; + vblocks=v_t; - fprintf(stderr,"."); - fprintf(stderr,"\n"); + //this is where the capturing happens. + rmdThreads(&pdata); - //encode and then cleanup cache - if(!pdata.args.encOnTheFly){ - if(!Aborted){ - EncodeCache(&pdata); - } - fprintf(stderr,"Cleanning up cache...\n"); - if(PurgeCache(pdata.cache_data,!pdata.args.nosound)) - fprintf(stderr,"Some error occured " - "while cleaning up cache!\n"); - fprintf(stderr,"Done!!!\n"); - } - //This can happen earlier, but in some cases it might get stuck. - //So we must make sure the recording is not wasted. - XCloseDisplay(pdata.dpy); + fprintf(stderr,"."); - if(Aborted && pdata.args.encOnTheFly){ - if(remove(pdata.args.filename)){ - perror("Error while removing file:\n"); - return 1; + fprintf(stderr,"\n"); + + //encode and then cleanup cache + if(!pdata.args.encOnTheFly){ + if(!Aborted){ + EncodeCache(&pdata); + } + fprintf(stderr,"Cleanning up cache...\n"); + if(PurgeCache(pdata.cache_data,!pdata.args.nosound)) + fprintf(stderr,"Some error occured " + "while cleaning up cache!\n"); + fprintf(stderr,"Done!!!\n"); } - else{ - fprintf(stderr,"SIGABRT received,file %s removed\n", - pdata.args.filename); - return 0; + + //This can happen earlier, but in some cases it might get stuck. + //So we must make sure the recording is not wasted. + XCloseDisplay(pdata.dpy); + + if(Aborted && pdata.args.encOnTheFly){ + if(remove(pdata.args.filename)){ + perror("Error while removing file:\n"); + return 1; + } + else{ + fprintf(stderr,"SIGABRT received,file %s removed\n", + pdata.args.filename); + return 0; + } } + else + fprintf(stderr,"Goodbye!\n"); } - else - fprintf(stderr,"Goodbye!\n"); } return exit_status; } |