Index: Slim/Player/StreamingController.pm =================================================================== --- Slim/Player/StreamingController.pm (revision 24478) +++ Slim/Player/StreamingController.pm (working copy) @@ -914,6 +914,15 @@ my $queue = $self->{'songqueue'}; + # bug 10510 - remove old songs from queue before adding new one + # (Note: did not just test for STATUS_PLAYING so as not to hardwire max-queue-length == 2 too often) + while (scalar @$queue && + ($queue->[-1]->{'status'} == Slim::Player::Song::STATUS_FAILED + || $queue->[-1]->{'status'} == Slim::Player::Song::STATUS_FINISHED)) + { + pop @$queue; + } + unshift @$queue, $song unless scalar @$queue && $queue->[0] == $song; if ($log->is_info) { $log->info("Song queue is now " . join(',', map { $_->{'index'} } @$queue));