fix(audio): smooth the passthrough audio clock on the mpv Android backend

Playing lossless passthrough audio (TrueHD, DTS-HD MA) on an Nvidia Shield
running Android 9 dropped a video frame every ten to twenty seconds with the
mpv backend, while lossy passthrough and PCM were unaffected and A/V sync
never moved (#2202).

IEC 61937 and raw passthrough tracks in ao_audiotrack never use
AudioTimestamp; their clock is AudioTrack.getPlaybackHeadPosition() taken at
face value, which on a direct track is the HAL's render position and
advances in HAL-period steps - 8192 frames at 192 kHz (42.7 ms) for the HBR
output on the Shield, longer than a 24p frame. The AO thread samples it once
per chunk and feeds it straight into the end time mpv schedules video
against, so a forward snap larger than a frame's remaining lead makes mpv
drop that frame; lossy passthrough runs at 48 kHz where the period stays
below a frame.

Move the native pin to edde746/mpv-build@af74e1906e, which estimates the
passthrough position the way media3 does: a ten-sample average of
(head - clock) offsets taken at least 30 ms apart, so a period-sized step is
spread over the window instead of landing on one frame. PCM tracks keep
their AudioTimestamp path. Apple, Linux and Windows assets are unchanged
(their content keys did not move).
This commit is contained in:
edde746
2026-09-03 05:35:03 +02:00
parent 9a9b89082b
commit aeb06c2c9e
10 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -802,7 +802,7 @@
repositoryURL = "https://github.com/edde746/mpv-build";
requirement = {
kind = revision;
revision = 0ad6388c2fb815d7d5b8bd54939a86c109900653;
revision = af74e1906ea94f7a92e31c16d21382b36e84d77b;
};
};
/* End XCRemoteSwiftPackageReference section */
@@ -32,7 +32,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "0ad6388c2fb815d7d5b8bd54939a86c109900653"
"revision" : "af74e1906ea94f7a92e31c16d21382b36e84d77b"
}
},
{
@@ -32,7 +32,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "0ad6388c2fb815d7d5b8bd54939a86c109900653"
"revision" : "af74e1906ea94f7a92e31c16d21382b36e84d77b"
}
},
{
+1 -1
View File
@@ -895,7 +895,7 @@
repositoryURL = "https://github.com/edde746/mpv-build";
requirement = {
kind = revision;
revision = 0ad6388c2fb815d7d5b8bd54939a86c109900653;
revision = af74e1906ea94f7a92e31c16d21382b36e84d77b;
};
};
/* End XCRemoteSwiftPackageReference section */
@@ -5,7 +5,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "0ad6388c2fb815d7d5b8bd54939a86c109900653"
"revision" : "af74e1906ea94f7a92e31c16d21382b36e84d77b"
}
},
{
@@ -5,7 +5,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "0ad6388c2fb815d7d5b8bd54939a86c109900653"
"revision" : "af74e1906ea94f7a92e31c16d21382b36e84d77b"
}
},
{
+10 -10
View File
@@ -4,23 +4,23 @@
"assetBase": "https://github.com/edde746/mpv-build/releases/download/binaries-android",
"assets": {
"arm64-v8a": {
"asset": "libmpv-android-4100c9eca4b1-arm64-v8a.tar.gz",
"checksum": "3791e8a00eda8c6977786777fba2c192a7f0175bf207299adf277be5f848d4d2"
"asset": "libmpv-android-3f9254df3c3d-arm64-v8a.tar.gz",
"checksum": "2e4168b2b020552d0593750ed4d5077c9431df91e271ce42e81735591a172b85"
},
"armeabi-v7a": {
"asset": "libmpv-android-4100c9eca4b1-armeabi-v7a.tar.gz",
"checksum": "0d2ef507becba6f08dd47379ad4a379700e6990970a5bb660f5597f17510e08b"
"asset": "libmpv-android-3f9254df3c3d-armeabi-v7a.tar.gz",
"checksum": "c0729781110f597e0572cdefe7cc1862e00f7b99ab46abfed910f56feb1d254f"
},
"x86": {
"asset": "libmpv-android-4100c9eca4b1-x86.tar.gz",
"checksum": "97225427a3cb56c77a7a6c90175199b7c328a7007144ba243cc60c774b4ea324"
"asset": "libmpv-android-3f9254df3c3d-x86.tar.gz",
"checksum": "b97d036809d713c8f3aac687f3e46f9fb5b6b2a6192402ddf9c0b9bfce9e12a0"
},
"x86_64": {
"asset": "libmpv-android-4100c9eca4b1-x86_64.tar.gz",
"checksum": "8f2058d3be4a9f480e699b02ed5399130161a69d7d2a46f15c9cf24ae7fe75a2"
"asset": "libmpv-android-3f9254df3c3d-x86_64.tar.gz",
"checksum": "96f583518f254c76135f3736e9a376941cc440dbccea982483c5fb0682c7a9fb"
}
},
"key": "4100c9eca4b1"
"key": "3f9254df3c3d"
},
"linux": {
"assetBase": "https://github.com/edde746/mpv-build/releases/download/binaries-linux",
@@ -51,7 +51,7 @@
"key": "1da76841036d"
}
},
"commit": "0ad6388c2fb815d7d5b8bd54939a86c109900653",
"commit": "af74e1906ea94f7a92e31c16d21382b36e84d77b",
"formatVersion": 1,
"repo": "edde746/mpv-build"
}
+1 -1
View File
@@ -1172,7 +1172,7 @@
repositoryURL = "https://github.com/edde746/mpv-build";
requirement = {
kind = revision;
revision = 0ad6388c2fb815d7d5b8bd54939a86c109900653;
revision = af74e1906ea94f7a92e31c16d21382b36e84d77b;
};
};
/* End XCRemoteSwiftPackageReference section */
@@ -6,7 +6,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "0ad6388c2fb815d7d5b8bd54939a86c109900653"
"revision" : "af74e1906ea94f7a92e31c16d21382b36e84d77b"
}
}
],
@@ -6,7 +6,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/edde746/mpv-build",
"state" : {
"revision" : "0ad6388c2fb815d7d5b8bd54939a86c109900653"
"revision" : "af74e1906ea94f7a92e31c16d21382b36e84d77b"
}
}
],