diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-12-13 14:53:02 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-12-13 14:53:02 +0000 |
commit | bfc243a25074f519b994bb34143dc211961ccae0 (patch) | |
tree | bd39cbd75e70793b44f12bc43ac6130e7b11ca6f /recordmydesktop/src/load_cache.c | |
parent | daac9c24a44eac7ba0a7ec292ee05117e06947bb (diff) |
doc/recordmydesktop.1: added documentation about -restore option
include/rmdfunc.h: read and write specs file function protorypes
include/rmdtypes.h, src/cache_audio.c src/capture_sound.c,
src/encode_sound_buffer.c, src/initialize_data.c, src/load_cache.c:
framesize moved to pdata struct(used to be initialized separately by
every function that used it).
src/Makefile.am: added src/rmd_restore.c
src/parseargs.c: handle -restore option
src/recordmydesktop.c: argument parsing moved before any X calls
(restore doesn't need a running X server)
src/rmd_restore.c: initialize all needed structs and data,
for restore to be performed. Then EncodeCache routine and exit.
src/specsfile.c: read and write specs file function bodies
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@474 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/load_cache.c')
-rw-r--r-- | recordmydesktop/src/load_cache.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/recordmydesktop/src/load_cache.c b/recordmydesktop/src/load_cache.c index a992a21..f67ae86 100644 --- a/recordmydesktop/src/load_cache.c +++ b/recordmydesktop/src/load_cache.c @@ -132,18 +132,8 @@ void *LoadCache(ProgData *pdata){ blocknum_y=pdata->enc_data->yuv.y_height/Y_UNIT_WIDTH, blockszy=Y_UNIT_BYTES,//size of y plane block in bytes blockszuv=UV_UNIT_BYTES;//size of u,v plane blocks in bytes -#ifdef HAVE_LIBASOUND - int framesize=((snd_pcm_format_width(SND_PCM_FORMAT_S16_LE))/8)* - pdata->args.channels;//audio frame size -#else - int framesize=pdata->args.channels<<1;//Always signed 16 bit data -#endif -#ifdef HAVE_JACK_H - if(pdata->args.use_jack) - framesize=sizeof(jack_default_audio_sample_t)* - pdata->jdata->nports; -#endif - signed char *sound_data=(signed char *)malloc(pdata->periodsize*framesize); + signed char *sound_data=(signed char *)malloc(pdata->periodsize* + pdata->sound_framesize); u_int32_t YBlocks[(yuv->y_width*yuv->y_height)/Y_UNIT_BYTES], UBlocks[(yuv->uv_width*yuv->uv_height)/UV_UNIT_BYTES], @@ -197,8 +187,12 @@ void *LoadCache(ProgData *pdata){ //sync missing_frames+=frame.header->current_total- (extra_frames+frame.header->frameno); - fprintf(stdout,"\r[%d%%] ", - ((frame.header->frameno+extra_frames)*100)/frames_total); + if(frames_total) + fprintf(stdout,"\r[%d%%] ", + ((frame.header->frameno+extra_frames)*100)/frames_total); + else + fprintf(stdout,"\r[%d frames rendered] ", + (frame.header->frameno+extra_frames)); fflush(stdout); if( (frame.header->Ynum<=blocknum_x*blocknum_y) && (frame.header->Unum<=blocknum_x*blocknum_y) && @@ -260,7 +254,8 @@ void *LoadCache(ProgData *pdata){ //audio load and encoding else{ if(!audio_end){ - int nbytes=fread(sound_data,1,pdata->periodsize*framesize,afp); + int nbytes=fread(sound_data,1,pdata->periodsize* + pdata->sound_framesize,afp); if(nbytes<=0) audio_end=1; else |