General fixes (#19)
* fix OOM crash by refactoring EpubImage to use lazy loading - Removed raw image ByteArray from EpubImage data class to prevent OutOfMemoryErrors on large books. - Updated EpubParser and MobiParser to only store image paths in the EpubBook object. - Images are now loaded on-demand from disk via file URIs in WebView and Coil, reducing initial heap allocation. * fix(tts): resolve OutOfMemoryError by removing large strings from state bundle - Removed 'currentText' from the TtsState bundle inside MediaSession custom layout. - Updated TtsController to retrieve the current text chunk via MediaItem metadata. - This prevents heap exhaustion caused by high-frequency serialization of large text strings during word tracking and polling updates.
This commit is contained in:
parent
a81df6921d
commit
d6837aa4df
5 changed files with 23 additions and 47 deletions
|
|
@ -615,7 +615,6 @@ class TtsPlaybackManager(
|
|||
private fun createStateButton(state: TtsState): CommandButton {
|
||||
val bundle = Bundle().apply {
|
||||
putBoolean("isLoading", state.isLoading)
|
||||
putString("currentText", state.currentText)
|
||||
putString("errorMessage", state.errorMessage)
|
||||
putString("speakerId", state.speakerId)
|
||||
putBoolean("sessionEndedByStop", state.sessionEndedByStop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue