diff --git a/Audio/Chain/ConverterNode.m b/Audio/Chain/ConverterNode.m index 3a709b96f..34981abf3 100644 --- a/Audio/Chain/ConverterNode.m +++ b/Audio/Chain/ConverterNode.m @@ -97,6 +97,9 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, UInt32* ioNumber NSLog(@"INSIZE: %i", amountRead); amountRead += [self convert:dest + amountRead amount:amount - amountRead]; } + else if (err != noErr && err != 100) { + NSLog(@"Error: %i", err); + } return amountRead; } diff --git a/Audio/CogAudio.xcodeproj/project.pbxproj b/Audio/CogAudio.xcodeproj/project.pbxproj index dfbf630c9..fe59ad04d 100644 --- a/Audio/CogAudio.xcodeproj/project.pbxproj +++ b/Audio/CogAudio.xcodeproj/project.pbxproj @@ -337,10 +337,12 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CogAudio" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 0867D691FE84028FC02AAC07 /* CogAudio */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; + projectRoot = ""; targets = ( 8DC2EF4F0486A6940098B216 /* CogAudio Framework */, ); diff --git a/Plugins/Flac/Flac.xcodeproj/project.pbxproj b/Plugins/Flac/Flac.xcodeproj/project.pbxproj index 2b37233bf..f45751263 100644 --- a/Plugins/Flac/Flac.xcodeproj/project.pbxproj +++ b/Plugins/Flac/Flac.xcodeproj/project.pbxproj @@ -183,6 +183,7 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Flac" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 089C166AFE841209C02AAC07 /* Flac */; projectDirPath = ""; @@ -192,6 +193,7 @@ ProjectRef = 17F5641A0C3BDC460019975C /* flac.xcodeproj */; }, ); + projectRoot = ""; targets = ( 8D5B49AC048680CD000E48DA /* Flac Plugin */, ); diff --git a/Plugins/Flac/FlacDecoder.m b/Plugins/Flac/FlacDecoder.m index 37d1f04b4..38d0068a6 100644 --- a/Plugins/Flac/FlacDecoder.m +++ b/Plugins/Flac/FlacDecoder.m @@ -90,6 +90,8 @@ FLAC__StreamDecoderWriteStatus WriteCallback(const FLAC__StreamDecoder *decoder, int sample, channel; int32_t audioSample; + NSLog(@"Bits per sample: %i", frame->header.bits_per_sample); + switch(frame->header.bits_per_sample) { case 8: // Interleave the audio (no need for byte swapping) @@ -198,6 +200,11 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS int count; int numread; + size -= size % ((bitsPerSample/8) * channels); + + NSLog(@"Requesting: %i", size); + NSLog(@"Overflow? %i", size % ((bitsPerSample/8) * channels)); + if (bufferAmount == 0) { if (FLAC__stream_decoder_get_state (decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) @@ -221,9 +228,17 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS memmove((char *)buffer, &((char *)buffer)[count], bufferAmount); if (count < size) - numread = [self fillBuffer:(&((char *)buf)[count]) ofSize:(size - count)]; + { + NSLog(@"Recursing: %i/%i", count, size); + + numread = [self fillBuffer:(((char *)buf) + count) ofSize:(size - count)]; + } else + { numread = 0; + } + + NSLog(@"Done: %i/%i", count + numread, size); return count + numread;