/[svn]/linuxsampler/trunk/src/engines/common/SampleFile.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/SampleFile.cpp

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

revision 3053 by persson, Thu Sep 11 18:22:14 2014 UTC revision 3054 by schoenebeck, Thu Dec 15 12:47:45 2016 UTC
# Line 223  namespace LinuxSampler { Line 223  namespace LinuxSampler {
223              const sf_count_t bufsize = CONVERT_BUFFER_SIZE / ChannelCount;              const sf_count_t bufsize = CONVERT_BUFFER_SIZE / ChannelCount;
224              unsigned char* const dst = static_cast<unsigned char*>(pBuffer);              unsigned char* const dst = static_cast<unsigned char*>(pBuffer);
225              while (count > 0) {              while (count > 0) {
226                  int n = sf_readf_int(pSndFile, pConvertBuffer, std::min(count, bufsize));                  int n = (int) sf_readf_int(pSndFile, pConvertBuffer, std::min(count, bufsize));
227                  if (n <= 0) break;                  if (n <= 0) break;
228                  for (int i = 0 ; i < n * ChannelCount ; i++) {                  for (int i = 0 ; i < n * ChannelCount ; i++) {
229                      dst[j++] = pConvertBuffer[i] >> 8;                      dst[j++] = pConvertBuffer[i] >> 8;
# Line 236  namespace LinuxSampler { Line 236  namespace LinuxSampler {
236          } else          } else
237  #endif  #endif
238          {          {
239              int bytes = sf_read_raw(pSndFile, pBuffer, FrameCount * GetFrameSize());              int bytes = (int)sf_read_raw(pSndFile, pBuffer, FrameCount * GetFrameSize());
240              return bytes / GetFrameSize();              return bytes / GetFrameSize();
241          }          }
242      }      }

Legend:
Removed from v.3053  
changed lines
  Added in v.3054

  ViewVC Help
Powered by ViewVC