Skip to content

Comments

playloop: only notify MP_EVENT_INPUT_PROCESSED when needed#16042

Merged
kasper93 merged 2 commits intompv-player:masterfrom
na-na-hi:input-processed
Mar 26, 2025
Merged

playloop: only notify MP_EVENT_INPUT_PROCESSED when needed#16042
kasper93 merged 2 commits intompv-player:masterfrom
na-na-hi:input-processed

Conversation

@na-na-hi
Copy link
Contributor

MP_EVENT_INPUT_PROCESSED is used to notify mouse and touch position updates, but it is currently notified for all input commands even when they have nothing to do with mouse position. This results in unnecessary acquisition and comparision of mouse and touch positions for all commands.

Optimize this by checking whether the command is marked as requiring the event notification, and only notify if that is true.

This makes it possible to distinguish these dummy commands
for position update notification from other commands.
MP_EVENT_INPUT_PROCESSED is used to notify mouse and touch position
updates, but it is currently notified for all input commands even when
they have nothing to do with mouse position. This results in unnecessary
acquisition and comparision of mouse and touch positions for all commands.

Optimize this by checking whether the command is marked as requiring the
event notification, and only notify if that is true.
@github-actions
Copy link

Download the artifacts for this pull request:

Windows
macOS

@kasper93 kasper93 added this to the Release v0.41.0 milestone Mar 12, 2025
@kasper93 kasper93 merged commit af1ac0f into mpv-player:master Mar 26, 2025
26 checks passed
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

Successfully merging this pull request may close these issues.

2 participants