-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix a crash in playerctld #215
Conversation
Some players, including VLC, will try to message playerctld on the following interfaces: * org.mpris.MediaPlayer2.TrackLis * org.mpris.MediaPlayer2.Playlists These are standard-compliant, but playerctld did not know about them and would crash on receiving such messages.
Notably, TrackList.Tracks doesn't get updated yet
* Add some comments * Refactor struct Player so that it keeps track of whether a given player appears to support the optional interfaces org.mpris.MediaPlayer2.TrackList and org.mpris.MediaPlayer2.Playlists * Attempt to fetch and cache properties from those optional interfaces * Note intent to listen for signals on optional MPRIS interfaces, in particular the TrackList one as it doesn't send the new values in PropertiesChanged signals. No actual work done yet, though.
Very nice, this looks like a good contribution. I'll review this as soon as I have some time. |
The test failure here is legitimate. I can reproduce it locally. |
What player are you using to test this? |
In |
More specifically, prevent playerctld from crashing when the only running player disappears. Yes, this was in the test suite, and no I somehow didn't notice it anyway.
So could I, and I'm not sure why I didn't notice that myself in the first place. The error was a null dereference causing playerctld to crash when the only open player is closed. I didn't notice it while dogfooding because I almost never close my web browser (which counts as a player). But missing the fact that a test was yelling at me is embarrassing.
Good point, working on it.
I've mainly tested with VLC (version 3.0.11.1) so far, since that's the only player I use that tries to implement either of these two interfaces. Admittedly, that means I didn't test There should probably be proper tests as well, I'll see if I can add some. |
I'm going to merge this as it is right now because it's good, but would appreciate some further work on those points. |
(cherry picked from commit b01290e) Reason: fixes a crash with TrackList and Playlists interfaces [1] [1]: altdesktop/playerctl#215
As part of the MPRIS standard, media players may optionally implement the interfaces
org.freedesktop.MediaPlayer2.TrackList
andorg.freedesktop.MediaPlayer2.Playlists
and send signals on those as well as sendingPropertiesChanged
signals for these interfaces' properties. While many players don't do this, some do.playerctld
notices these messages but fails to understand them, causing it to crash every time a player sent such a message (such as when opening or closing any file in VLC)These commits prevent that crash, and lay some groundwork for possibly having
playerctld
support those interfaces further in the future.