From b50ed675915706b001e9b45620fce0d76ba85381 Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Tue, 10 Feb 2015 21:42:36 -0800 Subject: [PATCH] Fixed Repeat None correctly this time --- Application/PlaybackController.m | 7 +++++-- Audio/AudioPlayer.m | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 6953b4267..17df92a23 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -478,12 +478,15 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe) else { pe = [playlistController getNextEntry:curEntry]; - if ([pe metadataLoaded] != YES) { + if (pe && [pe metadataLoaded] != YES) { [pe performSelectorOnMainThread:@selector(setMetadata:) withObject:[playlistLoader readEntryInfo:pe] waitUntilDone:YES]; } } - [player setNextStream:[pe URL] withUserInfo:pe withRGInfo:makeRGInfo(pe)]; + if (pe) + [player setNextStream:[pe URL] withUserInfo:pe withRGInfo:makeRGInfo(pe)]; + else + [player setNextStream:nil]; } - (void)audioPlayer:(AudioPlayer *)player didBeginStream:(id)userInfo diff --git a/Audio/AudioPlayer.m b/Audio/AudioPlayer.m index 0788928cb..9220f34c1 100644 --- a/Audio/AudioPlayer.m +++ b/Audio/AudioPlayer.m @@ -267,6 +267,10 @@ [nextStreamRGInfo retain]; [self requestNextStream: nextStreamUserInfo]; + + if (!nextStream) + return YES; + newChain = [[BufferChain alloc] initWithController:self]; endOfInputReached = YES;