diff --git a/EZAudio/EZAudioPlayer.m b/EZAudio/EZAudioPlayer.m index 56347ed0..76bfc56b 100644 --- a/EZAudio/EZAudioPlayer.m +++ b/EZAudio/EZAudioPlayer.m @@ -286,6 +286,9 @@ -(void) output:(EZOutput *)output audioBufferList:audioBufferList bufferSize:&bufferSize eof:&_eof]; + if (_eof && [self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:reachedEndOfAudioFile:)]) { + [self.audioPlayerDelegate audioPlayer:self reachedEndOfAudioFile:self.audioFile]; + } if( _eof && self.shouldLoop ) { [self seekToFrame:0]; diff --git a/EZAudio/EZAudioPlot.m b/EZAudio/EZAudioPlot.m index a1c4b9da..878b2bde 100644 --- a/EZAudio/EZAudioPlot.m +++ b/EZAudio/EZAudioPlot.m @@ -140,6 +140,12 @@ -(void)setSampleData:(float *)data free(plotData); } + //fixes issue where sometimes first sample data is 8k long, and locks thread + //for very intense drawing operation + if (length > self.rollingHistoryLength) { + return; + } + plotData = (CGPoint *)calloc(sizeof(CGPoint),length); plotLength = length;