ap4y / OrigamiEngine

Lightweight audio engine for iOS and OSX with flac, cue, mp3, m4a, m3u support.
http://ap4y.github.com/OrigamiEngine/
MIT License
545 stars 118 forks source link

engineExpectsNextUrl is called repeatly then crash even nil is returned #52

Open horaceho opened 9 years ago

horaceho commented 9 years ago

My delegate is simple as:

- (NSURL *)engineExpectsNextUrl:(ORGMEngine *)engine
{
    NSURL* url = nil;
    return url;
}

When a song is played to the end, the engineExpectsNextUrl delegate is called repeated for tens of times, then crash.

The same happens for a few .mp3, .flac and .wav files.

iOS 8.1.3 iPhone 6 Plus

PODS:
  - OrigamiEngine (1.0.14):
    - OrigamiEngine/Core (= 1.0.14)
  - OrigamiEngine/Core (1.0.14)
  - OrigamiEngine/Flac (1.0.14):
    - OrigamiEngine/Core
  - OrigamiEngine/Opus (1.0.14):
    - OrigamiEngine/Core
ap4y commented 9 years ago

I will check this over the weekend.

horaceho commented 9 years ago

I've upload my project to: https://github.com/horaceho/LosslessPlayer.git

A typical debug log looks like:

2015-02-27 10:09:34.386 Player[5288:1220583] -[AppDelegate application:didFinishLaunchingWithOptions:] backgroud play OK
2015-02-27 10:09:34.551 Player[5288:1220583] -[AppDelegate applicationDidBecomeActive:] backgroud play ACTIVE
2015-02-27 10:10:25.255 Player[5288:1220583] -[PlayViewController engine:didChangeState:] Playing /var/mobile/Containers/Data/Application/CF327B88-A464-42C5-944A-75D5312A4337/Documents/Prē.flac
2015-02-27 10:10:55.373 Player[5288:1220883] -[PlayViewController engineExpectsNextUrl:]
2015-02-27 10:10:55.559 Player[5288:1220883] -[PlayViewController engineExpectsNextUrl:]
2015-02-27 10:10:55.745 Player[5288:1220883] -[PlayViewController engineExpectsNextUrl:]
2015-02-27 10:10:55.930 Player[5288:1220883] -[PlayViewController engineExpectsNextUrl:]
2015-02-27 10:10:55.953 Player[5288:1220883] -[PlayViewController engineExpectsNextUrl:]
...
horaceho commented 9 years ago

More information ...

The podspec is using an old version of code as of: :tag => "1.0.14" https://github.com/ap4y/OrigamiEngine/commit/4c920f2ced665682c2d29ab938e76f5b46a2afad . There was a patch in later commit https://github.com/ap4y/OrigamiEngine/commit/5053bf16f90adbf3facd2d9408bf41c2e35b249b which supposed to fix the issue. However, the bug was not fixed.

endOfInput was kept changing by the [_input process]; loop, and triggers infinite observeValueForKeyPaths

daria-kopaliani commented 9 years ago

I have the same issue. Please let me know if you need help reproducing.