mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Fix crash when closing a not-yet-loaded popup.
This commit is contained in:
		| @@ -288,8 +288,11 @@ public abstract class BasePlayer implements | |||||||
|             if (item != null && item.getRecoveryPosition() == PlayQueueItem.RECOVERY_UNSET && isPlaybackResumeEnabled()) { |             if (item != null && item.getRecoveryPosition() == PlayQueueItem.RECOVERY_UNSET && isPlaybackResumeEnabled()) { | ||||||
|                 final Disposable stateLoader = recordManager.loadStreamState(item) |                 final Disposable stateLoader = recordManager.loadStreamState(item) | ||||||
|                         .observeOn(AndroidSchedulers.mainThread()) |                         .observeOn(AndroidSchedulers.mainThread()) | ||||||
|                         .doFinally(() -> initPlayback(queue, repeatMode, playbackSpeed, playbackPitch, playbackSkipSilence, |                         .doFinally(() -> { | ||||||
|                                 /*playOnInit=*/true)) |                             if (simpleExoPlayer == null) return; // doFinally called while closing | ||||||
|  |                             initPlayback(queue, repeatMode, playbackSpeed, playbackPitch, playbackSkipSilence, | ||||||
|  |                                     /*playOnInit=*/true); | ||||||
|  |                         }) | ||||||
|                         .subscribe( |                         .subscribe( | ||||||
|                                 state -> queue.setRecovery(queue.getIndex(), state.getProgressTime()), |                                 state -> queue.setRecovery(queue.getIndex(), state.getProgressTime()), | ||||||
|                                 error -> { |                                 error -> { | ||||||
| @@ -331,6 +334,7 @@ public abstract class BasePlayer implements | |||||||
|             simpleExoPlayer.removeListener(this); |             simpleExoPlayer.removeListener(this); | ||||||
|             simpleExoPlayer.stop(); |             simpleExoPlayer.stop(); | ||||||
|             simpleExoPlayer.release(); |             simpleExoPlayer.release(); | ||||||
|  |             simpleExoPlayer = null; | ||||||
|         } |         } | ||||||
|         if (isProgressLoopRunning()) stopProgressLoop(); |         if (isProgressLoopRunning()) stopProgressLoop(); | ||||||
|         if (playQueue != null) playQueue.dispose(); |         if (playQueue != null) playQueue.dispose(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox