From d77a5472f3dfef3e2b8ee5aa64aa30fc805368cd Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 9 Feb 2022 13:42:47 -0800 Subject: [PATCH] Only seek on restart if file is seekable Do not restart from the last position if file isn't seekable. Signed-off-by: Christopher Snowhill --- Application/PlaybackController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 5ce8862bd..f63a9bb9a 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -757,11 +757,11 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) { - (void)audioPlayer:(AudioPlayer *)player restartPlaybackAtCurrentPosition:(id)userInfo { PlaylistEntry *pe = [playlistController currentEntry]; BOOL paused = playbackStatus == CogStatusPaused; - [player play:[pe URL] withUserInfo:pe withRGInfo:makeRGInfo(pe) startPaused:paused andSeekTo:[pe currentPosition]]; + [player play:[pe URL] withUserInfo:pe withRGInfo:makeRGInfo(pe) startPaused:paused andSeekTo:[pe seekable] ? [pe currentPosition] : 0.0]; } - (void)audioPlayer:(AudioPlayer *)player pushInfo:(NSDictionary *)info toTrack:(id)userInfo { - PlaylistEntry *pe = (PlaylistEntry *)userInfo; + PlaylistEntry *pe = [playlistController currentEntry]; [pe setMetadata:info]; [playlistView refreshCurrentTrack:self]; [self sendMetaData];