[GH-ISSUE #484] Regression: Playback stops when a blocked song is encountered #305

Closed
opened 2026-02-27 19:29:55 +03:00 by kerem · 2 comments
Owner

Originally created by @Malvineous on GitHub (May 27, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/484

I just updated to git master and I have now found that when you are playing a playlist that contains songs blocked in your region, playback now completely stops when it encounters a blocked song. Previously the blocked song would just be skipped, and playback would continue with the next available song.

I've done some investigation and it looks like the problem appeared in commit 5784b465 by @kaymes with the changes for gapless playback. It looks like when a blocked song is encountered, player.rs:591 returns None, which results in spirc.rs:617 printing an error message and stopping playback completely.

It does appear to sometimes skip over the blocked song if gapless playback is enabled, while other times playback continues on the current song but once it finishes, it is no longer possible to start playback again until librespot is restarted.

As a test I changed spirc.rs to call self.handle_end_of_track() in the PlayerEvent::Stopped handler, and this fixed the problem. It is probably not the right solution so I only mention it as confirmation that the issue arises from either incorrectly issuing a PlayerEvent::Stopped when a song is unavailable, or incorrectly reacting to that event.

A test album to play to reproduce the problem is: https://open.spotify.com/album/4GYsHZzdfLdwNzRfDQ96vJ It has a couple of playable songs and a few blocked ones, so assuming it's similarly blocked in other regions it's a good test case. Otherwise you can add some normal and blocked songs to a playlist and test with that. If everything is working properly, you should be able to play the album from start to finish with the blocked songs being harmlessly skipped over.

Originally created by @Malvineous on GitHub (May 27, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/484 I just updated to git master and I have now found that when you are playing a playlist that contains songs blocked in your region, playback now completely stops when it encounters a blocked song. Previously the blocked song would just be skipped, and playback would continue with the next available song. I've done some investigation and it looks like the problem appeared in commit 5784b465 by @kaymes with the changes for gapless playback. It looks like when a blocked song is encountered, [player.rs:591](https://github.com/librespot-org/librespot/blob/e275f0a80d72c9414308589e6a54ffe11ab61dc6/playback/src/player.rs#L591) returns `None`, which results in [spirc.rs:617](https://github.com/librespot-org/librespot/blob/e275f0a80d72c9414308589e6a54ffe11ab61dc6/connect/src/spirc.rs#L617) printing an error message and stopping playback completely. It does appear to sometimes skip over the blocked song if gapless playback is enabled, while other times playback continues on the current song but once it finishes, it is no longer possible to start playback again until librespot is restarted. As a test I changed `spirc.rs` to call `self.handle_end_of_track()` in the `PlayerEvent::Stopped` handler, and this fixed the problem. It is probably not the right solution so I only mention it as confirmation that the issue arises from either incorrectly issuing a `PlayerEvent::Stopped` when a song is unavailable, or incorrectly reacting to that event. A test album to play to reproduce the problem is: https://open.spotify.com/album/4GYsHZzdfLdwNzRfDQ96vJ It has a couple of playable songs and a few blocked ones, so assuming it's similarly blocked in other regions it's a good test case. Otherwise you can add some normal and blocked songs to a playlist and test with that. If everything is working properly, you should be able to play the album from start to finish with the blocked songs being harmlessly skipped over.
kerem closed this issue 2026-02-27 19:29:55 +03:00
Author
Owner

@kaymes commented on GitHub (May 27, 2020):

Isn't this the issue that @ashthespy fixed in #474?

<!-- gh-comment-id:634408975 --> @kaymes commented on GitHub (May 27, 2020): Isn't this the issue that @ashthespy fixed in #474?
Author
Owner

@Malvineous commented on GitHub (May 27, 2020):

Oh sorry it is too - I looked through all the issues but didn't think to check the PRs! Running that PR now to see if it fixes the problem, will post a message there with my results.

<!-- gh-comment-id:634417716 --> @Malvineous commented on GitHub (May 27, 2020): Oh sorry it is too - I looked through all the issues but didn't think to check the PRs! Running that PR now to see if it fixes the problem, will post a message there with my results.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#305
No description provided.