Changeset 987fb86 for src/io


Ignore:
Timestamp:
Mar 23, 2013, 12:32:58 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
3286230, 52d6145
Parents:
6bbdcff
Message:

src/io/source_apple_audio.c: reset mDataByteSize in case of short read

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_apple_audio.c

    r6bbdcff r987fb86  
    238238
    239239uint_t aubio_source_apple_audio_seek (aubio_source_apple_audio_t * s, uint_t pos) {
     240  if (1) {
     241    AudioBufferList *bufferList = &s->bufferList;
     242    UInt32 samples = s->block_size * s->channels;
     243    Float64 rateRatio = s->samplerate / s->source_samplerate;
     244    uint_t segmentSize= (uint_t)(samples * rateRatio + .5);
     245    bufferList->mBuffers[0].mDataByteSize = segmentSize * sizeof(short);
     246  }
    240247  SInt64 resampled_pos = (SInt64)ROUND( pos * s->source_samplerate * 1. / s->samplerate );
    241248  OSStatus err = ExtAudioFileSeek(s->audioFile, resampled_pos);
Note: See TracChangeset for help on using the changeset viewer.