From bbfe7cf7833c6a296fe6bddfbb3cabbd0c26556c Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 1 Mar 2026 02:46:50 +0100 Subject: [PATCH] fix: use explicit mediacodec hwdec chain on android --- .../kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt | 2 +- lib/screens/video_player_screen.dart | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt b/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt index 0cbb13ca..3f35bf28 100644 --- a/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt +++ b/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt @@ -612,7 +612,7 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler, fallbackInProgress = false // Configure basic MPV properties for Plex playback - mpvCore?.setProperty("hwdec", "auto") + mpvCore?.setProperty("hwdec", "mediacodec,mediacodec-copy") mpvCore?.setProperty("vo", "gpu") mpvCore?.setProperty("ao", "audiotrack") diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index 6d2c0e90..0aa9f2aa 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -458,6 +458,11 @@ class VideoPlayerScreenState extends State with WidgetsBindin await player!.setProperty('sub-delay', offsetSeconds.toString()); } + // Apply audio normalization (loudnorm filter) + if (settingsService.getAudioNormalization()) { + await player!.setProperty('af', 'loudnorm=I=-14:TP=-3:LRA=4'); + } + // Apply custom MPV config entries final customMpvConfig = settingsService.getEnabledMpvConfigEntries(); for (final entry in customMpvConfig.entries) { @@ -2927,7 +2932,7 @@ String _getHwdecValue(bool enabled) { if (Platform.isMacOS || Platform.isIOS) { return 'videotoolbox'; } else if (Platform.isAndroid) { - return 'auto-safe'; + return 'mediacodec,mediacodec-copy'; } else { return 'auto'; // Windows, Linux }