playerctl incorrectly selects the player instance with the most recent activity rather than the instance specified by -p when playerctld is running. This bug only happens when the player with the .instance-AbCdEfGh suffix has the most recent activity.
Steps to reproduce:
- Run
playerctld daemon.
- Play two audio files in separate
mpv windows. I'll refer to them as 1.mp3 and 2.mp3, with 2.mp3 having been opened after 1.mp3.
- Interact with the window playing
2.mp3 to make mpv.instance-AbCdEfGh (the specific instance string is randomly generated each time) the player with the most recent activity. Verify this using playerctl -a metadata:
$ playerctl -a metadata -f "{{markup_escape(playerInstance)}}, {{markup_escape(title)}}"
mpv.instance-AbCdEfGh, 2.mp3
mpv, 1.mp3
- Try playing/pausing player
mpv.instance-AbCdEfGh; all the commands below correctly affect 2.mp3.
$ playerctl -p mpv.instance-AbCdEfGh play
$ playerctl -p mpv.instance-AbCdEfGh pause
$ playerctl -p mpv.instance-AbCdEfGh play-pause
- Try playing/pausing
mpv; all the commands below incorrectly affect 2.mp3 instead of 1.mp3.
$ playerctl -p mpv play
$ playerctl -p mpv pause
$ playerctl -p mpv play-pause
- Interact with the window playing
1.mp3 to make mpv the player with the most recent activity. Verify this using playerctl -a metadata:
$ playerctl -a metadata -f "{{markup_escape(playerInstance)}}, {{markup_escape(title)}}"
mpv, 1.mp3
mpv.instance-AbCdEfGh, 2.mp3
- Try playing/pausing player
mpv; all the commands below correctly affect 1.mp3.
$ playerctl -p mpv play
$ playerctl -p mpv pause
$ playerctl -p mpv play-pause
- Try playing/pausing
mpv.instance-AbCdEfGh; notice how these commands correctly affect 2.mp3, showing the bug only occurs when mpv.instance-AbCdEfGh has the most recent activity.
$ playerctl -p mpv.instance-AbCdEfGh play
$ playerctl -p mpv.instance-AbCdEfGh pause
$ playerctl -p mpv.instance-AbCdEfGh play-pause
When playerctld is not running mpv will always rank higher than mpv.instance-AbCdEfGh because the former was opened first, meaning the bug does not occur as step 8 has shown.
System info:
OS: Fedora 43 Sway spin
playerctl version: 2.4.1
playerctlincorrectly selects the player instance with the most recent activity rather than the instance specified by-pwhenplayerctldis running. This bug only happens when the player with the.instance-AbCdEfGhsuffix has the most recent activity.Steps to reproduce:
playerctld daemon.mpvwindows. I'll refer to them as1.mp3and2.mp3, with2.mp3having been opened after1.mp3.2.mp3to makempv.instance-AbCdEfGh(the specific instance string is randomly generated each time) the player with the most recent activity. Verify this usingplayerctl -a metadata:$ playerctl -a metadata -f "{{markup_escape(playerInstance)}}, {{markup_escape(title)}}" mpv.instance-AbCdEfGh, 2.mp3 mpv, 1.mp3mpv.instance-AbCdEfGh; all the commands below correctly affect2.mp3.mpv; all the commands below incorrectly affect2.mp3instead of1.mp3.1.mp3to makempvthe player with the most recent activity. Verify this usingplayerctl -a metadata:$ playerctl -a metadata -f "{{markup_escape(playerInstance)}}, {{markup_escape(title)}}" mpv, 1.mp3 mpv.instance-AbCdEfGh, 2.mp3mpv; all the commands below correctly affect1.mp3.mpv.instance-AbCdEfGh; notice how these commands correctly affect2.mp3, showing the bug only occurs whenmpv.instance-AbCdEfGhhas the most recent activity.When
playerctldis not runningmpvwill always rank higher thanmpv.instance-AbCdEfGhbecause the former was opened first, meaning the bug does not occur as step 8 has shown.System info:
OS: Fedora 43 Sway spin
playerctl version: 2.4.1