mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
perf(mornye): release outgoing artwork decoders when replaced
Retain the outgoing decoder only while its frame remains displayed, then release its provider subscription as soon as replacement artwork is ready. Verify decoder disposal while preserving cover transitions.
This commit is contained in:
1 parent
a7717ddfbf
commit
6038ce5777
2 files changed
+8
-5
No files matched your search
@@ -53,11 +53,6 @@ class _MornyePlayerArtworkState extends ConsumerState<MornyePlayerArtwork> {
|
||||
return fallback;
|
||||
}
|
||||
final videoUrl = widget.videoUrl;
|
||||
// Keep one outgoing decoder alive until the next cover is ready. Rapid
|
||||
// skips must not replace a visible frame with a loading placeholder.
|
||||
if (_displayedSource != null && _displayedSource != videoUrl) {
|
||||
ref.watch(playerArtworkVideoProvider(_displayedSource!));
|
||||
}
|
||||
final prepared = videoUrl == null
|
||||
? null
|
||||
: ref.watch(playerArtworkVideoProvider(videoUrl));
|
||||
@@ -74,6 +69,12 @@ class _MornyePlayerArtworkState extends ConsumerState<MornyePlayerArtwork> {
|
||||
_displayedSource = null;
|
||||
_displayedController = null;
|
||||
}
|
||||
// Retain the outgoing decoder only while it is still displayed. Watching
|
||||
// it before accepting the new frame keeps its heap alive until a later
|
||||
// unrelated rebuild, even after the old banner has been removed.
|
||||
if (_displayedSource != null && _displayedSource != videoUrl) {
|
||||
ref.watch(playerArtworkVideoProvider(_displayedSource!));
|
||||
}
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
|
||||
Reference in new issue
Block a user