Merge pull request #81 from AndrewKosovich/master

Ported error handling from the previous Audjustable player.
This commit is contained in:
Thong Nguyen 2014-02-14 12:16:10 +00:00
commit 8c608440ae
1 changed files with 11 additions and 0 deletions

View File

@ -1470,6 +1470,17 @@ static void AudioFileStreamPacketsProc(void* clientData, UInt32 numberBytes, UIn
}
}
if (read < 0)
{
// iOS will shutdown network connections if the app is backgrounded (i.e. device is locked when player is paused)
// We try to reopen -- should probably add a back-off protocol in the future
long long position = currentlyReadingEntry.dataSource.position;
[currentlyReadingEntry.dataSource seekToOffset:position];
return;
}
int flags = 0;
if (discontinuous)