/[svn]/libgig/trunk/src/gigextract.cpp
ViewVC logotype

Diff of /libgig/trunk/src/gigextract.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 364 by schoenebeck, Wed Aug 18 12:11:26 2004 UTC revision 365 by persson, Thu Feb 10 19:16:31 2005 UTC
# Line 188  void ExtractSamples(gig::File* gig, char Line 188  void ExtractSamples(gig::File* gig, char
188    
189    
190  #if USE_DISK_STREAMING  #if USE_DISK_STREAMING
         if (pSample->Compressed) { // hack  
             pSample->BitDepth  = 16;  
             pSample->FrameSize = 4;  
         }  
   
191          long neededsize = (pSample->Compressed) ? 10485760 /* 10 MB buffer */          long neededsize = (pSample->Compressed) ? 10485760 /* 10 MB buffer */
192                                                  : pSample->SamplesTotal * pSample->FrameSize;                                                  : pSample->SamplesTotal * pSample->FrameSize;
193          if (BufferSize < neededsize) {          if (BufferSize < neededsize) {
# Line 207  void ExtractSamples(gig::File* gig, char Line 202  void ExtractSamples(gig::File* gig, char
202          uint8_t* pSamplePiece = pWave;          uint8_t* pSamplePiece = pWave;
203          do { // we read the sample in small pieces and increment the size with each run just to test streaming capability          do { // we read the sample in small pieces and increment the size with each run just to test streaming capability
204              readinthisrun = pSample->Read(pSamplePiece, ++samplepiecesize);              readinthisrun = pSample->Read(pSamplePiece, ++samplepiecesize);
205              pSamplePiece += readinthisrun * pSample->FrameSize;              // 24 bit is truncated to 16 by Sample::Read at the moment
206                pSamplePiece += readinthisrun * (2 * pSample->Channels); // readinthisrun * pSample->FrameSize;
207              readsamples  += readinthisrun;              readsamples  += readinthisrun;
208          } while (readinthisrun == samplepiecesize);          } while (readinthisrun == samplepiecesize);
209    
210          if (pSample->Compressed) { // hack          if (pSample->Compressed) { // hack
211              pSample->SamplesTotal = readsamples;              pSample->SamplesTotal = readsamples;
212                pSample->BitDepth = 16;
213          }          }
214  #  else // read in one piece  #  else // read in one piece
215          if (pSample->Compressed) {          if (pSample->Compressed) {

Legend:
Removed from v.364  
changed lines
  Added in v.365

  ViewVC Help
Powered by ViewVC