From 82ad49ee09c7d60371aaa0d21391c96889bb2497 Mon Sep 17 00:00:00 2001 From: Eric Goldberg Date: Fri, 5 Jun 2015 20:43:06 -0700 Subject: [PATCH 1/2] Fix deadlock from drawing 8k of buffer data in context --- EZAudio/EZAudioPlot.m | 6 ++++++ 1 file changed, 6 insertions(+) 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; From 6fc0f8a31fa192f8e784556ab667d33f58341338 Mon Sep 17 00:00:00 2001 From: Eric Goldberg Date: Tue, 9 Jun 2015 18:18:05 -0700 Subject: [PATCH 2/2] Fix EZAudioPlayer not calling EOF reached delegate method --- EZAudio/EZAudioPlayer.m | 3 +++ 1 file changed, 3 insertions(+) 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];