Skip to content

fix(windows): rewrite audio timing model and adaptive frame polling#188

Merged
kdroidFilter merged 3 commits into
masterfrom
fix/windows-audio-timing-master
Apr 11, 2026
Merged

fix(windows): rewrite audio timing model and adaptive frame polling#188
kdroidFilter merged 3 commits into
masterfrom
fix/windows-audio-timing-master

Conversation

@kdroidFilter
Copy link
Copy Markdown
Owner

@kdroidFilter kdroidFilter commented Apr 11, 2026

Summary

  • Rewrite Windows AudioManager to use audio-as-timing-master model (matching macOS AVPlayer): audio thread feeds decoded PCM to WASAPI with no drift correction, sleeps, or sample dropping — video compensates via audioLatencyMs
  • Add adaptive frame polling interval based on native video frame rate to prevent starving the audio thread on the shared SourceReader
  • Add pre-fill audio buffer on seek for gapless playback
  • Include pre-built DLLs for x86-64 and ARM64
  • Add jdk.accessibility module for Linux desktop packaging

Test plan

  • Play a video on Windows and verify smooth audio/video sync
  • Seek multiple times rapidly and confirm no audio gaps or stutter
  • Change playback speed (0.5x, 1.5x, 2x) and verify audio pitch/speed changes correctly
  • Pause/resume and verify seamless continuation
  • Test on ARM64 Windows if available
  • Verify Linux desktop app still launches correctly with the new module

…rame polling

Rewrite the Windows AudioManager to use the audio-as-timing-master pattern
(matching macOS AVPlayer). The audio thread feeds decoded PCM to WASAPI as
fast as the buffer allows, with no wall-clock drift correction, sleeps, or
sample dropping. Video compensates via audioLatencyMs. This eliminates
stutter bugs after seek, resume, or speed changes.

Also:
- Add adaptive frame polling interval based on native video frame rate
  (prevents starving the audio thread on the shared SourceReader)
- Add pre-fill audio buffer on seek for gapless playback
- Include pre-built DLLs for x86-64 and ARM64
- Add jdk.accessibility module for Linux desktop packaging
@kdroidFilter kdroidFilter force-pushed the fix/windows-audio-timing-master branch from 602fdc6 to e519e09 Compare April 11, 2026 17:07
@kdroidFilter kdroidFilter merged commit a572047 into master Apr 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant