Skip to content
Snippets Groups Projects
Commit f5d15e94 authored by Alex Merry's avatar Alex Merry
Browse files

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
parent 28daff80
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment