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 is not shown if the video is paused at the same time #8821

Closed
occivink opened this issue May 9, 2021 · 5 comments
Closed

osd-overlay is not shown if the video is paused at the same time #8821

occivink opened this issue May 9, 2021 · 5 comments

Comments

@occivink
Copy link
Contributor

occivink commented May 9, 2021

Important Information

mpv 0.33.0-150-gea89e813f7 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Sun May  9 15:10:23 CEST 2021
FFmpeg library versions:
   libavutil       56.70.100
   libavcodec      58.134.100
   libavformat     58.76.100
   libswscale      5.9.100
   libavfilter     7.110.100
   libswresample   3.9.100
FFmpeg version: n4.4

built on arch linux.

Reproduction steps

Use the following script

ov = mp.create_osd_overlay("ass-events")
ov.data = "{\\an5}{\\b1}hello world!"
local shown = false

mp.add_key_binding("k", function()
    if not shown then
        mp.set_property_bool("pause", true)
        ov:update()
    else
        mp.set_property_bool("pause", false)
        ov:remove()
    end
    shown = not shown
end)

with mpv --no-config --script=test.lua somevideo

Press k repeatedly to trigger the script.

Expected behavior

When pressing k, the video is paused and the overlay 'hello world!' is shown immediately.

Actual behavior

The overlay is only shown some of the time. Most of the time, the text does not appear until some other event refreshes the video (resize, mouse hover...).
Note that the same problem applies to image overlays made with the command overlay-add.

Log file

log.txt

@avih
Copy link
Member

avih commented May 9, 2021

Duplicate of #8172 and #8350 .

@avih avih closed this as completed May 9, 2021
@avih
Copy link
Member

avih commented May 9, 2021

For reference, it's not specific to mp.create_osd_overlay. It's a general issue with rendering any overlay (OSD, etc) while pause is toggled, e.g. with this binding at input.cont:

SPACE osd-msg cycle pause

If there's no video playing (e.g. mpv --idle --force-window) and you press space, then you'll see OSD message of both pause: yes and pause: no.

But if there is a video playing, then not all presses of space show a message. E.g. on my system it typically shows only pause: no.

It's probably a race condition between displaying a new OSD thing, while also changing the throttling of OSD overlays (immediate while paused, synced to the next video frame while playing).

@occivink
Copy link
Contributor Author

occivink commented May 9, 2021

Thanks for the extra info. I've also noticed that with video-sync=display-resample, the OSD updates consistently as expected.

@avih
Copy link
Member

avih commented May 9, 2021

I've also noticed that with video-sync=display-resample, the OSD updates consistently as expected.

Next time, when you open an issue which is not a duplicate, consider adding such info instead of keeping it to yourself.

You're a developer, so put your yourself in our shoes: wouldn't you think this kind of info is helpful in understanding what affects the issue? Wouldn't you prefer that the reporter added such info if they new about it?

@occivink
Copy link
Contributor Author

occivink commented May 9, 2021

Well, I only realized after I tried out your binding in my own config and could not reproduce it, whereas I could with --no-config. I didn't purposely hide anything.

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

No branches or pull requests

2 participants