Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd_overlay doesn't update in async callback #10227

Closed
familyfriendlymikey opened this issue May 25, 2022 · 2 comments · Fixed by #11283
Closed

osd_overlay doesn't update in async callback #10227

familyfriendlymikey opened this issue May 25, 2022 · 2 comments · Fixed by #11283

Comments

@familyfriendlymikey
Copy link

familyfriendlymikey commented May 25, 2022

Important Information

  • mpv version: 0.34.1
  • macOS Version: Monterey 12.1
  • Source of the mpv binary or bundle: homebrew
  • Tested on Windows 10 scoop binary as well

Reproduction steps

  1. Download script:
ass_overlay = mp.create_osd_overlay("ass-events")
ass_overlay.data = "This should go away in one second."
ass_overlay.hidden = true
ass_overlay:update()

local function ass_overlay_on()
	ass_overlay.hidden = false
	ass_overlay:update()
end

local function ass_overlay_off()
	ass_overlay.hidden = true
	ass_overlay:update()
end

local function test_overlay_async()
	ass_overlay_on()
	mp.add_timeout(1, ass_overlay_off)
end

mp.add_key_binding("0", "test_overlay_async", test_overlay_async)
  1. Open video file, loading script:
mpv --no-config --script=test_overlay_async.lua test_video.mkv
  1. Pause video.
  2. Press 0.

Expected behavior

The overlay should disappear in one second.

Actual behavior

The overlay does not disappear unless playback is resumed.

Additional Info

Per another IRC user's testing, if you modify this function like so:

local function ass_overlay_off()
	ass_overlay:update()
	ass_overlay.hidden = true
	ass_overlay:update()
end

it works as expected again.

@avih
Copy link
Member

avih commented May 25, 2022

Yeah, can confirm this happens on linux too.

I don't think it's related to #9735 , but the fact that it only happens while paused (or in general withuot a video), makes it possibly related.

This could take some digging into OSD states... or if someone wants to apply the patch at #9735 and test if it still happens...

@guidocella
Copy link
Contributor

I can reproduce this even after applying #9735.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants