[Play Events] Don't bug on end of playlist
Don't bug out on end of playlist, when didBeginStream will receive a nil track pointer, which should result in unsetting the current track in the player, and not send a DidBegin notification to everything, including the visualization views' event handlers. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
5c4cfb4053
commit
8068a506b9
|
@ -617,12 +617,15 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
||||||
|
|
||||||
// Delay the action until this function has returned to the audio thread
|
// Delay the action until this function has returned to the audio thread
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
|
||||||
|
if(pe) {
|
||||||
[[FIRCrashlytics crashlytics] logWithFormat:@"Updating UI with track: %@", pe.url];
|
[[FIRCrashlytics crashlytics] logWithFormat:@"Updating UI with track: %@", pe.url];
|
||||||
|
}
|
||||||
|
|
||||||
[self->playlistController setCurrentEntry:pe];
|
[self->playlistController setCurrentEntry:pe];
|
||||||
|
|
||||||
if(self->_eq)
|
if(pe && self->_eq) {
|
||||||
equalizerApplyGenre(self->_eq, [pe genre]);
|
equalizerApplyGenre(self->_eq, [pe genre]);
|
||||||
|
}
|
||||||
|
|
||||||
self->lastPosition = -10;
|
self->lastPosition = -10;
|
||||||
|
|
||||||
|
@ -631,7 +634,9 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
||||||
[self removeHDCD:nil];
|
[self removeHDCD:nil];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(pe) {
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:CogPlaybackDidBeginNotficiation object:pe];
|
[[NSNotificationCenter defaultCenter] postNotificationName:CogPlaybackDidBeginNotficiation object:pe];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)audioPlayer:(AudioPlayer *)player didChangeStatus:(NSNumber *)s userInfo:(id)userInfo {
|
- (void)audioPlayer:(AudioPlayer *)player didChangeStatus:(NSNumber *)s userInfo:(id)userInfo {
|
||||||
|
|
Loading…
Reference in New Issue