fix(tv): destroy mpv instance before re-negotiating stream on audio switch

This commit is contained in:
Gauvain
2026-07-06 22:21:28 +02:00
parent ab90a1a52e
commit 271ed84811

View File

@@ -905,6 +905,11 @@ export default function DirectPlayerPage() {
bitrateValue: bitrateValue?.toString() ?? "",
playbackPosition: msToTicks(progress.get()).toString(),
}).toString();
// Destroy the current mpv instance BEFORE navigating, same rationale as
// goToNextItem/goToPreviousItem: Expo Router briefly holds two players
// during the transition, and two simultaneous decoders OOM-kill low-RAM
// devices. Resume is preserved via the playbackPosition param.
videoRef.current?.destroy().catch(() => {});
router.replace(`player/direct-player?${queryParams}` as any);
return;
}