MPRIS2: avoid updating Metadata when between tracks
When changing tracks, we would emit PropertiesChanged for Metadata twice, once with mpris:trackid set to /org/kde/amarok/PendingTrack and once with the actual new trackid (because the first time the playlist code had not yet updated the active track). If the track was changed manually (not just progressing to the next one) we would often also emit a PropertiesChanged with an empty Metadata before repopulating it. This solves the first issue by making the signal connection for trackChanged from EngineController queued, meaning that by the time the MPRIS2 code gets the signal, the playlist has updated the activeTrack and we can easily figure out the correct trackid. It solves the second issue by ignoring the trackLengthChanged signal when it has a meaningless value (<0), which seems to happen at some point during track changes that are not predictable. BUG: 321602 REVIEW: 111512
Loading
Please register or sign in to comment