Skip to content

Commit f5a4af2

Browse files
committed
Player: destroy -> saveAndShutdown
1 parent 06cf511 commit f5a4af2

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,15 @@ private void destroyPlayer() {
591591
}
592592
}
593593

594-
public void destroy() {
594+
595+
/**
596+
* Shut down this player.
597+
* Saves the stream progress, sets recovery.
598+
* Then destroys the player in all UIs and destroys the UIs as well.
599+
*/
600+
public void saveAndShutdown() {
595601
if (DEBUG) {
596-
Log.d(TAG, "destroy() called");
602+
Log.d(TAG, "saveAndShutdown() called");
597603
}
598604

599605
saveStreamProgressState();

app/src/main/java/org/schabi/newpipe/player/PlayerService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class PlayerService : MediaBrowserServiceCompat() {
226226
// notify that the player is being destroyed
227227
onPlayerStartedOrStopped!!.accept(null)
228228
}
229-
player!!.destroy()
229+
player!!.saveAndShutdown()
230230
player = null
231231
}
232232

0 commit comments

Comments
 (0)