-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
input/player: add loadfile/loadlist insert-at command
- Loading branch information
1 parent
da75319
commit c678033
Showing
4 changed files
with
113 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the third argument be made to only be taken for these two flags and otherwise keep options as the third argument, so that loadfile retains backward compatability?
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, would be awesome if some sort of backward compatibility could be brought back. Now with every new release mpv is unusable in apps relying on the "old" and established syntax. I guess I will open a bug report for this...
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original implementation attempted backwards compatibility, but I deemed it far too complex and we went with this instead. I can think of a hack to keep backwards compatibility but not sure it should really be done. Is the
options
argument really that commonly used for this to be a big problem? I would not think so. It is not like properties/commands are never supposed to change.c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not that rare, but another issue is clarity. What is suppose to go in the index argument for the other flags? There is no
Default
construct, and including a random value on the other flags is somewhat confusing.c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it says "This argument will be ignored for all other actions." You can put whatever number you want. It's just not used.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate that it's easy to work around. IMO this functionality already existed, albeit with multiple steps, so is not worth breaking compatibility and readability.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least Plex HTPC (haven´t tested Plex for Desktop) uses the loadfile command and will not play any file with the new commit. The log states that the syntax is wrong.
I assume other apps are broken too now.
I will now maintain a fork with this commit reverted. With this one reverted Plex HTPC works as expected... Having a fork just for the purpose of having one commit reverted is probably not ideal, however...
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I don't know the inner workings of Plex but it's not like it's hard to update syntax (and not sure why they would unconditionally pass the options argument in the first place). It's not like this is a C API that never has incompatible changes.
However, see #13624 which will make it backwards compatible again.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats true, but Plex is probably not able to update the syntax. It would probably break their (outdated) stripped-down correctly licensed version of mpv.
Thanks for pointing out the new PR! Awesome! Will try this! Thanks!
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does Plex care about a new upstream change if they're using an outdated stripped down version of mpv?
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don´t know if Plex cares about upstream changes but the users do - like me. The mpv.dll can be swapped on their apps to get some nice new features. Thats why we care about upstream compatibility. ;)
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see why mpv should try to not break command syntax or IPC to maintain compatibility with Plex Media Player's outdated mpv version
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plex Media Player is dead for years. ^^ The current app is called Plex HTPC. It was just an example mentioned by me.
There are probably other non-plex apps that are broken due to this change. @bitingsock what app is affected on your side?
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean yeah that's not really my main concern. However, extending generally useful functionality to commands is nice and can save you from typing
-1
so Plex people benefiting is just a side effect.c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less of an issue because I actively maintain it, but my youtube playlist preloading script requires the old syntax. Easy fix there.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote a hack that simplifies the loadfile command that Plex calls; you don't need a separate maintained fork with one commit excluded. https://github.com/yuv420p10le/plex_loadfile_hook
Hopefully Plex will just fix it on their end, and update libmpv; as needing to do this at all is pretty inconvenient.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a breaking API change. If commands weren't part of the API, you couldn't use libmpv for anything. Shame on @Dudemanguy for trying to defend his failure as maintainer.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a documented breaking change. Sometimes commands have breaking changes between versions. I'm sorry that you might have to spend a couple of seconds to change 1 or 2 lines in your code. If Plex didn't apparently unconditionally use the options argument or used named arguments instead, I doubt half the complaints on this commit would even exist.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will fix the bugs for free and you will be happy.
Anyway, it's an unnecessary breaking change in a command that needs to be used by every single API user. Plex was brought up only later.
c678033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am inclined to complain on this commit... (url PCigales/DLNAmpvRenderer@7f9c08d), but thank you anyway for all the work on this media player.