From 3f0bc74c21e5de982836a5c1786955238893f83b Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 24 Dec 2025 13:03:27 -0600 Subject: [PATCH] Enable constant bitrate seeking to fix AAC seek reset in ExoPlayer --- .../audiobookshelf/app/player/PlayerNotificationService.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt b/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt index a967345b..84152019 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt @@ -480,6 +480,8 @@ class PlayerNotificationService : MediaBrowserServiceCompat() { val dataSourceFactory = DefaultDataSource.Factory(ctx) val extractorsFactory = DefaultExtractorsFactory() + extractorsFactory.setConstantBitrateSeekingEnabled(true) + if (DeviceManager.deviceData.deviceSettings?.enableMp3IndexSeeking == true) { // @see // https://exoplayer.dev/troubleshooting.html#why-is-seeking-inaccurate-in-some-mp3-files @@ -494,6 +496,8 @@ class PlayerNotificationService : MediaBrowserServiceCompat() { val dataSourceFactory = DefaultHttpDataSource.Factory() val extractorsFactory = DefaultExtractorsFactory() + extractorsFactory.setConstantBitrateSeekingEnabled(true) + if (DeviceManager.deviceData.deviceSettings?.enableMp3IndexSeeking == true) { // @see // https://exoplayer.dev/troubleshooting.html#why-is-seeking-inaccurate-in-some-mp3-files