mpv-player / mpv-player/mpv

opengl-cb: update callback being called when not ready yet

Open
#4,852 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

mpv version and platform

latest git master, macOS 10.12.5

Reproduction steps

using --vo=opengl-cb --dither-size-fruit=8 leads to a black screen on playback start. i could reproduce it with git master, with a cocoa libmpv example and with my cocoa-cb branch (#4833).

Expected behavior

either doesn't start playback yet and/or renders the actual frame.

Actual behavior

initialising such a big dither matrix takes quite a long time, mpv can't actually render frames yet, but already starts playback. despite that the opengl-cb update callback is already being called and the following draw call is blocking. this leads to a black screen but the audio already playing. this also deactivates display-resample since it is reported as a massive amount of dropped frames. after some time, when the matrix is initialised, the frames start to draw.

with opengl it doesn't start playback till the matrix is actually initialised.

Log file

https://0x0.st/7zF.txt

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 with the --vo=opengl-cb path and its update callback, then compare startup behavior with regular opengl. Reproduce with --dither-size-fruit=8 using a Cocoa libmpv example and inspect the linked log. Done means playback does not invoke updates before rendering is ready and avoids the reported black screen and premature audio.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api, desktop
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.