From 986e769ac0fca14866cc399f28ffcb5357da9bdc Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Fri, 4 Sep 2026 06:14:18 +0200 Subject: [PATCH] fix(player): stop subtitle updates from dropping video frames on the mpv Android backend With the mpv backend on Android, every subtitle change cost two dropped video frames on a Fire TV Cube (36 per minute with PGS SDH subtitles, 15 with srt, #2240) and accounts for the residual drops on the Shield in #2202, whose sessions also had subtitles on. The diagnostic build showed the drops in pairs: a frame handed over on time, then the video thread waking 90-100 ms late. vo_mediacodec rasterized subtitles and blitted them into the OSD Surface on that thread, and locking the Surface waits CPU-side for the compositor - dequeue plus the release fence, one or two vsyncs, 42-83 ms at 23.976 Hz. Kodi, VLC 4 and ExoPlayer all keep subtitle output off the presentation thread. Move the native pin to edde746/mpv-build@88c1b135e70d: the whole OSD stage runs on its own thread, fed with the video pts at every flip, so the video thread never waits on the compositor or on libass. Subtitles latch on the same vsync as the video in the common case and one later when the lock has to wait. Shield on vo=mediacodec with ASS subtitles: no video-thread stage over 10 ms and 0 drops across five 150 s runs, subtitles verified on screen; DTS-HD MA 4K unchanged at 0 drops. The pin keeps the #2202 diagnostics and adds VO stage timing to them. Apple, Linux and Windows assets are unchanged. --- ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- macos/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- mpv-build.lock.json | 20 +++++++++---------- tvos/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 263787b32..68f8ddf7d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -802,7 +802,7 @@ repositoryURL = "https://github.com/edde746/mpv-build"; requirement = { kind = revision; - revision = a58f0c1336e63b42be7af86b0a61b336e8cc8503; + revision = 88c1b135e70de1c7004d2fd5559ac0965782cbce; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 79863fe44..2281af7c3 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,7 +32,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/mpv-build", "state" : { - "revision" : "a58f0c1336e63b42be7af86b0a61b336e8cc8503" + "revision" : "88c1b135e70de1c7004d2fd5559ac0965782cbce" } }, { diff --git a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 79863fe44..2281af7c3 100644 --- a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,7 +32,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/mpv-build", "state" : { - "revision" : "a58f0c1336e63b42be7af86b0a61b336e8cc8503" + "revision" : "88c1b135e70de1c7004d2fd5559ac0965782cbce" } }, { diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 898a0a630..335f7ec7a 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -895,7 +895,7 @@ repositoryURL = "https://github.com/edde746/mpv-build"; requirement = { kind = revision; - revision = a58f0c1336e63b42be7af86b0a61b336e8cc8503; + revision = 88c1b135e70de1c7004d2fd5559ac0965782cbce; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index be73efa59..bd1c4cd65 100644 --- a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,7 +5,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/mpv-build", "state" : { - "revision" : "a58f0c1336e63b42be7af86b0a61b336e8cc8503" + "revision" : "88c1b135e70de1c7004d2fd5559ac0965782cbce" } }, { diff --git a/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index be73efa59..bd1c4cd65 100644 --- a/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,7 +5,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/mpv-build", "state" : { - "revision" : "a58f0c1336e63b42be7af86b0a61b336e8cc8503" + "revision" : "88c1b135e70de1c7004d2fd5559ac0965782cbce" } }, { diff --git a/mpv-build.lock.json b/mpv-build.lock.json index 91c61ed92..ecabe0aa0 100644 --- a/mpv-build.lock.json +++ b/mpv-build.lock.json @@ -4,23 +4,23 @@ "assetBase": "https://github.com/edde746/mpv-build/releases/download/binaries-android", "assets": { "arm64-v8a": { - "asset": "libmpv-android-1d716ccdffdc-arm64-v8a.tar.gz", - "checksum": "9f554bed4fff924d69c18523aaa5180cc39652c59182fb054e7e9e37e6976246" + "asset": "libmpv-android-720132fd31ef-arm64-v8a.tar.gz", + "checksum": "326693e4d1bf76dd0f91772bddb64ab98ae6f0199b04be289566131389618bd4" }, "armeabi-v7a": { - "asset": "libmpv-android-1d716ccdffdc-armeabi-v7a.tar.gz", - "checksum": "e4b1a6ed2b82e52eff416d14f0f948e75a7f208f10f666d2d81c618a7b95487a" + "asset": "libmpv-android-720132fd31ef-armeabi-v7a.tar.gz", + "checksum": "531747a7d13ff272bf6fec52a458ec75f1d7eced85c54df05d3f745ab85f50af" }, "x86": { - "asset": "libmpv-android-1d716ccdffdc-x86.tar.gz", - "checksum": "f0ed63358bfcf86e3779f80130a40c75787228a3c75a110091b373180d68f696" + "asset": "libmpv-android-720132fd31ef-x86.tar.gz", + "checksum": "9d72bab8f7bc4395df1fc241920c595eb5f1da559d33b7d9fe52034c12814261" }, "x86_64": { - "asset": "libmpv-android-1d716ccdffdc-x86_64.tar.gz", - "checksum": "1ab49328f224d0a24db0b67a73fd123ac11f7d87d7511dceffbfcbbecd937a45" + "asset": "libmpv-android-720132fd31ef-x86_64.tar.gz", + "checksum": "f445f0eb299b59f2ed9f37b33cf23d12492e3cb23cf1fe4d4411e6343b4cf5f5" } }, - "key": "1d716ccdffdc" + "key": "720132fd31ef" }, "linux": { "assetBase": "https://github.com/edde746/mpv-build/releases/download/binaries-linux", @@ -51,7 +51,7 @@ "key": "500299d05130" } }, - "commit": "a58f0c1336e63b42be7af86b0a61b336e8cc8503", + "commit": "88c1b135e70de1c7004d2fd5559ac0965782cbce", "formatVersion": 1, "repo": "edde746/mpv-build" } diff --git a/tvos/Runner.xcodeproj/project.pbxproj b/tvos/Runner.xcodeproj/project.pbxproj index 1ef596182..56d81777e 100644 --- a/tvos/Runner.xcodeproj/project.pbxproj +++ b/tvos/Runner.xcodeproj/project.pbxproj @@ -1175,7 +1175,7 @@ repositoryURL = "https://github.com/edde746/mpv-build"; requirement = { kind = revision; - revision = a58f0c1336e63b42be7af86b0a61b336e8cc8503; + revision = 88c1b135e70de1c7004d2fd5559ac0965782cbce; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index cb4600597..39191e2ca 100644 --- a/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/mpv-build", "state" : { - "revision" : "a58f0c1336e63b42be7af86b0a61b336e8cc8503" + "revision" : "88c1b135e70de1c7004d2fd5559ac0965782cbce" } } ], diff --git a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index cb4600597..39191e2ca 100644 --- a/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/tvos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/edde746/mpv-build", "state" : { - "revision" : "a58f0c1336e63b42be7af86b0a61b336e8cc8503" + "revision" : "88c1b135e70de1c7004d2fd5559ac0965782cbce" } } ],