fix(player): smooth mp2 audio sync correction#570
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-570.eastasia.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-570.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8f1b14e73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-570.eastasia.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-570.eastasia.1.azurestaticapps.net |
Summary
Smooths initial MP2 software audio synchronization by preferring WSOLA ratio correction over rebuilding the WebAudio chain. Hard resync is now reserved for large discontinuities, while startup and larger-but-recoverable drift use a wider temporary correction window before returning to steady-state drift control.
Also fixes the fresh
/playermount path after always enabling MP2 software decoding: the segments effect now letshandleLoadSegments()perform the lazy active-slot player creation instead of returning before any MediaSource/player exists.It also ignores expected interrupted
play()AbortErrors caused by superseded load requests, without swallowing autoplayNotAllowedErrors.The old PCM passthrough stretcher fallback has been removed. If WSOLA cannot be created, software-decoded PCM now fails explicitly instead of entering a no-rate-matching mode that cannot converge soft sync drift.
This keeps channel switches fast because audio still starts immediately, but avoids clipping/rebuilding the chain for normal startup drift. The PR intentionally excludes
src/embedded_web_data.h.Validation
pnpm exec biome check web-ui/src/mpegts/audio/wasm-stretcher.ts web-ui/src/mpegts/audio/pcm-audio-player.ts web-ui/src/components/player/video-player.tsxpnpm run type-check:tscNotes
I did not run
pnpm run web-ui:buildafter this update because this PR should not include regenerated embedded web assets.