mpv-player / mpv-player/mpv

Consider making `overlay_id` client local

Open
#17,534 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Expected behavior of the wanted feature

This was discussed on the IRC but I doubt anyone immediately working on it so I'm making this issue so that it doesn't get lost. The TL;DR is that currently, overlay_id that's accepted by overlay-{add,remove} is completely free for all.

Meaning one script can just overwrite another script's overlay. There's also no way to know which overlay id is active since overlay ids are just arbitrarily assigned by the client rather than something that needs to be acquired by something like mp.get_overlay_id().

This may not cause any problem if you don't use scripts that use (many) overlay but there exist scripts such as https://github.com/occivink/mpv-gallery-view which does make use of many overlays, and so this can easily create situation where scripts end up stomping each other's overlay id.

One obvious way to solve this would be to make the overlay ids client local. This would prevent sharing overlay ids (e.g overlay added by one client cannot be removed/overwritten by another) but I'm not sure if there's any script that's purposefully sharing ids to begin with. But if there are, we can probably accommodate for that as well by adding something like mp.get_global_overlay_id_from_local_id() or whatever.

cc: @guidocella

Alternative behavior of the wanted feature

No response

Log File

No response

Sample Files

No response

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

The relevant entry points named here are overlay-{add,remove} and the scripting API proposal for mp.get_overlay_id(); begin by tracing how those commands assign and resolve IDs. A contribution is complete only after ownership semantics are agreed, including whether scripts that share IDs remain supported and how local IDs map to global ones.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.