Skip to content

Commit 07590eb

Browse files
authored
fix for avenginesoundplayer multiplay - closes #7931 (#7945)
#changelog #avengine
1 parent 5c4cac7 commit 07590eb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ - (BOOL)loadWithURL:(NSURL*)url {
593593
self.soundFile = nil;
594594
return NO;
595595
}else{
596-
NSLog(@"Sound file %@ loaded!", url);
596+
//NSLog(@"Sound file %@ loaded!", url);
597597
}
598598

599599
return [self loadWithSoundFile:self.soundFile];
@@ -614,7 +614,7 @@ - (void)startEngine{
614614
problem = YES;
615615

616616
} else {
617-
NSLog(@"Engine start successful");
617+
//NSLog(@"Engine start successful");
618618
if(self.resetAudioEngine) {
619619
// [self engineReset];
620620
if(self.resetAudioEngine == NO)
@@ -847,11 +847,13 @@ - (void)pause {
847847
}
848848

849849
- (void)stop {
850-
851-
__typeof(self) __weak weak_self = self;
850+
if (!_bIsPlaying) {
851+
return;
852+
}
852853

853854
if(_isSessionInterrupted || _isConfigChangePending){
854855
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3f), dispatch_get_main_queue(), ^{
856+
__typeof(self) __weak weak_self = self;
855857
[weak_self stop];
856858
});
857859
return;
@@ -868,6 +870,7 @@ - (void)stop {
868870
self.startedSampleOffset = 0;
869871
}
870872

873+
871874
//----------------------------------------------------------- states.
872875
- (BOOL)isLoaded {
873876
return (self.soundPlayer != nil);

0 commit comments

Comments
 (0)