-
Notifications
You must be signed in to change notification settings - Fork 3k
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
player: add immediate command prefix #15913
base: master
Are you sure you want to change the base?
Conversation
dc415c7
to
fec1212
Compare
Download the artifacts for this pull request: |
New command prefix need to be added to these places as well. Lines 1669 to 1677 in fc2f176
Lines 414 to 420 in fc2f176
|
fec1212
to
3690c47
Compare
Shouldn't the whole feature go through a deprecation period? We added a new behavior that breaks multiple use-cases (this subtitle thing and hwdec thing), now we add a command prefix to revert to old behavior. This is breaking change and we need to give users time to migrate their scripts to This defered options callback invites all sort of race conditions like shown by |
To be fair, that didn't really work before. You would need some kind of queueing approach to wait until the hwdec is actually set for real before printing it no matter what.
It's always been a bit racy. The earlier hwdec is a good example since it may take a few frames before it gets applied. So if you do a get right after setting it, it could be wrong. This specific script has failures because it sets the Deprecating is easy enough and I'm not like opposed to it or anything. All I'd have to do is make immediate always true, but I'm not sure how we would actually communicate that to users. I mean yeah we can put it in the release notes/docs but is anyone going to really read it? I don't think printing a warning makes much sense either. |
I don't mind either way. We need to be careful not to release next stable version without making sure it is safe. I'm fine with having this change, but we need to monitor the impact. It's basically Hyrum's law, it really doesn't matter how we define this, what matters how it works and if it start breaking scripts even in subtle way, because they depended on some strange behavior it's a problem. |
I think it's clear now that the impact of this change was very underestimated. Instead of this command prefix, the option change coalescing should be disabled for |
I'd appreciate it if we could at least wait until there's a sample size greater than 1 before we start making melodramatic statements. |
This doesn't work for me. I end up with messed up timestamps. I tried adding |
3690c47
to
d5a78de
Compare
Sorry implementation flaw on my part. Does it work correctly now? |
Every change breaks someone's workflow and sure enough a user pointed out that bbac628 degraded one of their scripts. It was very timing sensitive and inherently relied on the immediate update behavior of the old code. We'd still like to coalesce these by default, sending notifications to property observers are coalesced after all, but some users do have a genuine use case for the old behavior. So solve this by adding a new 'immediate' command prefix. If passed, the option update will trigger its callback immediately and skip the internal queueing process. Note that the implementation of this means it will only work with the property manipulation commands (set, multiply, cycle-values, etc.) and not any mpv_set_property type API. But that's OK, using these commands have the exact same end effect.
d5a78de
to
fa9fb53
Compare
It works now, even without adding the To make the script backwards compatible I'll need some way to check if |
It's silly but something like this would work.
|
Considering that this is a temporary solution, I guess that would work. |
cc @christoph-heinrich: I think with this you just need to do this (potential backwards compatibility handling ignored):
And you'll get the old behavior back.