Skip to content

Commit 3dba254

Browse files
committed
Fixed #98
1 parent 6ceb970 commit 3dba254

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

  • core/src/main/java/xyz/gianlu/librespot/player

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ public void previous() {
7070
private void handleFrame(@NotNull Spirc.MessageType type, @NotNull Spirc.Frame spircFrame, @Nullable Remote3Frame frame) {
7171
switch (type) {
7272
case kMessageTypeNotify:
73-
if (spirc.deviceState().getIsActive() && spircFrame.getDeviceState().getIsActive()) {
74-
spirc.deviceState().setIsActive(false);
75-
state.setStatus(Spirc.PlayStatus.kPlayStatusStop);
76-
if (trackHandler != null && !trackHandler.isStopped()) trackHandler.sendStop();
77-
state.updated();
73+
if (spirc.deviceState().getIsActive() && frame != null) {
74+
if (frame.isPlaying && !frame.isPaused) {
75+
spirc.deviceState().setIsActive(false);
76+
state.setStatus(Spirc.PlayStatus.kPlayStatusStop);
77+
if (trackHandler != null && !trackHandler.isStopped()) trackHandler.sendStop();
78+
state.updated();
7879

79-
LOGGER.warn("Stopping player due to kMessageTypeNotify!");
80+
LOGGER.warn("Stopping player due to kMessageTypeNotify!");
81+
}
8082
}
8183
break;
8284
case kMessageTypeLoad:

0 commit comments

Comments
 (0)