Skip to content

Commit 2c7acd0

Browse files
committed
Remove OALSimpleAudio workaround
1 parent 3ada189 commit 2c7acd0

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

external/ObjectAL/OALSimpleAudio.m

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -659,31 +659,11 @@ - (void) unloadAllEffects
659659
return nil;
660660
}
661661

662-
#if 0 // __CC_PLATFORM_ANDROID
663-
// TODO: we are creating a player and throwing it away each time, and not taking into account if it was preloaded.
664-
// think about checking for preload and implement the player's asyncPrepare finish listener
665-
AndroidAssetFileDescriptor *assetFd = [[[CCActivity currentActivity] assets] openFdWithFileName:filePath];
666-
667-
if (assetFd.fileDescriptor && [assetFd.fileDescriptor valid]) {
668-
AndroidMediaPlayer *player = [[AndroidMediaPlayer alloc] init];
669-
[player reset];
670-
[player setDataSource:assetFd.fileDescriptor offset:assetFd.startOffset length:assetFd.length];
671-
#warning TODO: note sure how to set on finished listener for player and call the player's release() (not objc release) in the callback to close fd
672-
[player prepare];
673-
[player start];
674-
}
675-
676-
if (assetFd) {
677-
[assetFd close];
678-
}
679-
// TODO: convert to ALSoundSource and return
680-
#else
681662
ALBuffer* buffer = [self internalPreloadEffect:filePath reduceToMono:NO];
682663
if(nil != buffer)
683664
{
684665
return [channel play:buffer gain:volume pitch:pitch pan:pan loop:loop];
685666
}
686-
#endif
687667
return nil;
688668
}
689669

0 commit comments

Comments
 (0)