Skip to content

Commit

Permalink
Update StreamingController.pm
Browse files Browse the repository at this point in the history
Added undef checks for $elapsed and $song->duration() at line 1429.
  • Loading branch information
kwarklabs authored May 4, 2022
1 parent 25d7e8e commit ada52a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Slim/Player/StreamingController.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,9 @@ sub _willRetry {

# Have we managed to play at least 10 seconds of a track and retried fewer times than there are intervals?
my $elapsed = $self->playingSongElapsed();
if ($song->retryData->{'count'} > scalar @retryIntervals || $elapsed < 10 || ($song->duration() - $elapsed < 10)) {
if ( main::DEBUGLOG && $log->is_debug ) {$log->debug("Will not retry - too many retries already or track is within 10 seconds of start or end.")};
if ($song->retryData->{'count'} > scalar @retryIntervals || !$elapsed || $elapsed < 10 ||
!$song->duration() || ($song->duration() - $elapsed < 10)) {
if ( main::DEBUGLOG && $log->is_debug ) {$log->debug("Will not retry - no player sync, too many retries or track within 10 seconds of start or end.")};
return 0;
}

Expand Down

0 comments on commit ada52a5

Please sign in to comment.