diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-12-09 14:54:00 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-12-09 14:54:00 +0000 |
commit | 9659592e810f34724abbb76d072472ceca4bbc97 (patch) | |
tree | 17fbafcf2b40913a43e266291e6b191a43d10bb4 /recordmydesktop/src/load_cache.c | |
parent | 5cc91a08f6313e0b758063b7dfd31244d43eb9a0 (diff) |
corrected(added) eos on both streams
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@226 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/load_cache.c')
-rw-r--r-- | recordmydesktop/src/load_cache.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/recordmydesktop/src/load_cache.c b/recordmydesktop/src/load_cache.c index 8a61159..eee3fb7 100644 --- a/recordmydesktop/src/load_cache.c +++ b/recordmydesktop/src/load_cache.c @@ -48,8 +48,6 @@ void *LoadCache(ProgData *pdata){ FILE *afp=pdata->cache_data->afp; FrameHeader fheader; CachedFrame frame; - signed char *sound_data=(signed char *)malloc(pdata->periodsize); - int j=0, nth_cache=1, audio_end=0, @@ -59,7 +57,10 @@ void *LoadCache(ProgData *pdata){ thread_exit=0,//0 success, -1 couldn't find files,1 couldn't remove divisor=16, blockszy=0,//size of y plane block in bytes - blockszuv=0;//size of u,v plane blocks in bytes + blockszuv=0,//size of u,v plane blocks in bytes + framesize=((snd_pcm_format_width(SND_PCM_FORMAT_S16_LE))/8)*pdata->args.channels;//audio frame size + signed char *sound_data=(signed char *)malloc(pdata->periodsize*framesize); + //we allocate the frame that we will use INIT_FRAME(&frame,&fheader,yuv) //and the we open our files @@ -185,7 +186,7 @@ void *LoadCache(ProgData *pdata){ //audio load and encoding else{ if(!audio_end){ - int nbytes=fread(sound_data,pdata->periodsize,1,afp); + int nbytes=fread(sound_data,pdata->periodsize*framesize,1,afp); if(nbytes<=0) audio_end=1; else |