mpv-player / mpv-player/mpv

lavfi-complex amix can desync when seeking

Open
#16,333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

mpv Information
mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Apr  4 2025 07:28:54
libplacebo version: v7.349.0
FFmpeg version: n7.1 (runtime n7.1.1)
FFmpeg library versions:
   libavcodec      61.19.100 (runtime 61.19.101)
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100
Other Information
- Linux version: Arch Linux
- Kernel Version: Linux pond 6.14.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 03 May 2025 13:34:12 +0000 x86_64 GNU/Linux
Reproduction Steps

I attached a reproduction zip containing 2 audio files and a lua script.

reproducing command:
mpv --no-config --script=repro.lua inst.ogg --force-window

mpv-repro.zip

Apologies for the large file size, I couldn't reproduce if I cut the beginning of the song with ffmpeg, so it seems
like this bug is encoding-dependent, but I can't figure out how exactly.

Expected Behavior

When playing without seeking, or seeking to 0, the two mixed tracks sync up perfectly.

Actual Behavior

Seeking using the scroll bar in the mpv gui can cause desync, depending on where you seek.
The desync is most noticable at the 00:39 mark, where the instruments and the voices are supposed to hit the same notes in unison.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided command with repro.lua and inst.ogg, then reproduce the desync by seeking around 00:39. Trace the lavfi-complex amix behavior during seeking and compare it with playback from the start or seeking to 0. Done means the mixed instruments and voices remain synchronized after seeking.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.