Skip to content

Commit 140171d

Browse files
committed
Fixed #44
1 parent 3142108 commit 140171d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

core/src/main/java/xyz/gianlu/librespot/player/Player.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void frame(@NotNull Spirc.Frame frame) {
8383
if (spirc.deviceState().getIsActive() && frame.getDeviceState().getIsActive()) {
8484
spirc.deviceState().setIsActive(false);
8585
state.setStatus(Spirc.PlayStatus.kPlayStatusStop);
86-
if (trackHandler != null) trackHandler.sendStop();
86+
if (trackHandler != null && !trackHandler.isStopped()) trackHandler.sendStop();
8787
stateUpdated();
8888
}
8989
break;

core/src/main/java/xyz/gianlu/librespot/player/TrackHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ void sendStop() {
8787
sendCommand(Command.Stop);
8888
}
8989

90+
boolean isStopped() {
91+
return stopped;
92+
}
93+
9094
void sendLoad(@NotNull TrackId track, boolean play, int pos) {
9195
sendCommand(Command.Load, track, play, pos);
9296
}

0 commit comments

Comments
 (0)