diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index a99613b4..6d85d128 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -2690,10 +2690,14 @@ public class DownloadService extends Service { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { float playbackSpeed = getPlaybackSpeed(); - if(Math.abs(playbackSpeed - 1.0) > 0.01 || mediaPlayer.getPlaybackParams() != null) { - PlaybackParams playbackParams = new PlaybackParams(); - playbackParams.setSpeed(playbackSpeed); - mediaPlayer.setPlaybackParams(playbackParams); + try { + if (Math.abs(playbackSpeed - 1.0) > 0.01 || mediaPlayer.getPlaybackParams() != null) { + PlaybackParams playbackParams = new PlaybackParams(); + playbackParams.setSpeed(playbackSpeed); + mediaPlayer.setPlaybackParams(playbackParams); + } + } catch(Exception e) { + Log.e(TAG, "Error while applying media player params", e); } } } |