mirror of
https://github.com/devgianlu/librespot-android.git
synced 2026-04-26 13:55:53 +03:00
[GH-ISSUE #16] Clicking on 'Play' multiple times crashes the player #12
Labels
No labels
bug
enhancement
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot-android#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vhaudiquet on GitHub (Jan 8, 2022).
Original GitHub issue: https://github.com/devgianlu/librespot-android/issues/16
Clicking on the play button rapidly for 4-5 times instantly crashes the player, with this stack trace :
This can be considered a bug in librespot-java (the 'Player' does not accept multiple load requests in a short time) or a bug in librespot-android (if it is not a bug in librespot-java, then we should implement a way of not sending the request if the player is already processing requests).
Anyway, i'd like to hear what should be done on this, so that i know if I should implement a request queue and wait for player readyness or if this should be done directly into librespot-java in a next release.
@mitschwimmer commented on GitHub (Jan 9, 2022):
I would not consider this a bug in librespot-java, although it surely could be more robust in this case.
From my point of view this should be handled in the UI layer. If this was not a call to a backing library but, let's say, a service calling someones backend via network, it might be a bit more obvious. But I think this is more or less the same situation.
You could, for example, implement a state machine to decide what to allow a user to do at which given state.
I will put this issue in the README as an example of one of the requirements librespot-android is lacking as an integration showcase in contrast to being an app meant to be used by real users.
@vhaudiquet commented on GitHub (Jan 9, 2022):
I tried implementing such a thing, but even doing waitReady() calls and surrounding the function with a volatile boolean global variable to allow only one execution at a time does not seem enough. I think the API does not allow to get the state of the player properly so it is not really possible to do that...
Even waiting for everything, i get (in my app) to another crash :
I can't seem to find a way to implement something where the user can spam click.
This is not a major issue tho, as with those 'fixes' (waiting with a while loop inside the function), the user has to spam click really really fast, which i don't think would happen on a normal use scenario.
@iscle commented on GitHub (Feb 7, 2022):
In this case I think you you should open an issue on the librespot-java repo and I will try to take a look at it if devgianlu does not have time :)