Back to feed
Dev.to
Dev.to
6/26/2026
How a stale audio batch caused 7 seconds of A/V desync after backward seeks

How a stale audio batch caused 7 seconds of A/V desync after backward seeks

Short summary

FastPlay, a Rust Windows video player, had a bug where audio desynchronized up to 7 seconds after backward seeks due to stale audio batch state surviving the seek operation. The root cause was an audio batcher that didn't reset its partial state during seeks, allowing pre-seek timestamps to corrupt post-seek audio timing. The fix was adding an AudioBatcher::reset() method called during seek to discard stale state, ensuring audio timestamps stay anchored to the correct playback position.

  • Backward seeks exposed a bug where audio could jump 7 seconds ahead of video in FastPlay, while forward seeks masked the problem
  • Root cause: AudioBatcher retained stale pre-seek state that survived codec flush, using old timestamps for new audio
  • Fix: Added AudioBatcher::reset() during seek to discard partial batches and synchronize timestamp anchoring

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more