ao_avfoundation frame drops and audio delay on playback speed changes

Open
#14,483 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Reproduce the issue with mpv --no-config --ao=avfoundation and playback-speed changes using [ and ], then review the attached output.txt alongside the avfoundation audio-output path. Compare behavior with CoreAudio; done means speed changes apply promptly without audio/video desynchronization, freezes, or reported dropped frames.

Written by the indexing model from the issue text.

Description

ao:avfoundation os:mac
mpv Information
mpv v0.38.0-570-ge78e2c73cf Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Jul  4 2024 19:10:37
libplacebo version: v7.349.0
FFmpeg version: 7.0.1
FFmpeg library versions:
   libavcodec      61.3.100
   libavdevice     61.1.100
   libavfilter     10.1.100
   libavformat     61.1.100
   libavutil       59.8.100
   libswresample   5.1.100
   libswscale      8.1.100
Important Information
  • Platform version: macOS 14.5
  • GPU model, driver and version: M1 Max
  • Source: local build
  • Introduced in version: ?
Reproduction Steps

Play any video with mpv --no-config --ao=avfoundation, change the playback speed with [ and ].

Expected Behavior

Similar performance to CoreAudio, which can handle speed changes smoothly.

Actual Behavior

When increasing or decreasing playback speed, the audio doesn't change speed until a few seconds later (and is out of sync with the video until then).

There are also video stutters: when speed is increased, the video freezes (but mpv doesn't report dropped frames), when decreased there is a smaller stutter with dropped frames reported.

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:
  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

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.

More from mpv-player/mpv

All issues in mpv-player/mpv

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.