From 663f58eb03ce8bcaa21e751077144faaaf202b32 Mon Sep 17 00:00:00 2001 From: iovar Date: Sat, 11 Nov 2006 00:00:24 +0000 Subject: Cache files are now broken on 500mb parts, measured always as uncomressed bytes as gzwrite returns them, in order to avoid gzlib 2 gb file size limit. CacheFileN,SwapCacheFilesWrite,SwapCacheFilesRead functions have been added to achieve this without messing with normal operation(i.e. the rest of the program keeps operating on the same file pointer). Also PurgeCache function has been added to separate the task from encoding itself. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@160 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/load_cache.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'recordmydesktop/src/load_cache.c') diff --git a/recordmydesktop/src/load_cache.c b/recordmydesktop/src/load_cache.c index ffa3d67..2606900 100644 --- a/recordmydesktop/src/load_cache.c +++ b/recordmydesktop/src/load_cache.c @@ -51,6 +51,7 @@ void *LoadCache(void *pdata){ signed char *sound_data=(signed char *)malloc(((ProgData *)pdata)->periodsize); int j=0, + nth_cache=1, audio_end=0, extra_frames=0,//total number of duplicated frames missing_frames=0,//if this is found >0 current run will not load @@ -171,7 +172,13 @@ void *LoadCache(void *pdata){ } } else{ - raise(SIGINT); + if(SwapCacheFilesRead(((ProgData *)pdata)->cache_data->imgdata,nth_cache,&ifp,&ucfp)){ + raise(SIGINT); + } + else{ + fprintf(stderr,"\t[Cache File %d]",nth_cache); + nth_cache++; + } continue; } } @@ -190,25 +197,8 @@ void *LoadCache(void *pdata){ CLEAR_FRAME(&frame) free(sound_data); - if(!((ProgData *)pdata)->args.zerocompression) - gzclose(ifp); - else - fclose(ucfp); - - if(remove(((ProgData *)pdata)->cache_data->imgdata)){ - fprintf(stderr,"Couldn't remove temporary file %s",((ProgData *)pdata)->cache_data->imgdata); - thread_exit=1; - } if(!((ProgData *)pdata)->args.nosound){ fclose(afp); - if(remove(((ProgData *)pdata)->cache_data->audiodata)){ - fprintf(stderr,"Couldn't remove temporary file %s",((ProgData *)pdata)->cache_data->audiodata); - thread_exit=1; - } - } - if(remove(((ProgData *)pdata)->cache_data->projname)){ - fprintf(stderr,"Couldn't remove temporary directory %s",((ProgData *)pdata)->cache_data->projname); - thread_exit=1; } pthread_exit(&thread_exit); -- cgit v1.2.1