Bug 358135 - Media Player widget in expanded mode makes Amarok skip tracks
Summary: Media Player widget in expanded mode makes Amarok skip tracks
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Media Player (show other bugs)
Version: 5.5.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-17 17:11 UTC by edward.lara.lara
Modified: 2016-01-19 22:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.6.0
Sentry Crash Report:


Attachments
Reset seek slider position when changing songs (2.18 KB, patch)
2016-01-17 17:20 UTC, edward.lara.lara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description edward.lara.lara 2016-01-17 17:11:08 UTC
Amarok does not seem to send position updates to the mpris interface when a new song starts just as there are no frequent updates sent. The media player slider then stays at the same position (except for the timer updates). Something seems to trigger a setPosition after that making either skip a portion of the song if the new track is longer, or skipping completely if the new track is shorter.


Reproducible: Always

Steps to Reproduce:
1. Add the media player to the desktop and expand so the seek slide bar would show up when playing music
2. Add a list of songs to Amarok such the following cases occur: a song followed by a shorter song, a song followed by a longer song and a song followed by a song of exactly the same size (the same song twice works)
3. Start playing the list in Amarok and watch what happens at transition from song to song (you can open Amarok in a way that you can see both Amarok and the Media Player and in Amarok move the seek slider close to the end of the songs)

Actual Results:  
If the next song is shorter the slider then goes outside the range when the maximum size is reset and one song would be skipped entirely and the other would skip a portion
If the next song is longer a portion will be skipped

Expected Results:  
the media player slider should reset to the track position in Amarok at the transitions
Comment 1 edward.lara.lara 2016-01-17 17:20:45 UTC
Created attachment 96700 [details]
Reset seek slider position when changing songs

The attached patch retrieves the position from the player when:
* a new maximum is set to the slider (most cases)
* the the slider is already at the end (when the same song is played again)

Note that adding 1 sec to the slider when the remaining is less than a second sets the slider to maximum. Handling at that moment seemed to be too soon when I tried it. Waiting for the next iteration looked to be a better transition
Comment 2 Kai Uwe Broulik 2016-01-17 17:26:04 UTC
Thank you very much for the patch!

> Amarok does not seem to send position updates to the mpris interface when a new song starts

That seem to be the missing part in the puzzle to figure out what went wrong all the time. Please head to https://git.reviewboard.kde.org and submit this patch there for review.
Comment 3 edward.lara.lara 2016-01-17 17:49:38 UTC
Hi Kal,

Thank you for the link. I was not familiar with the review board. Here is the request:
https://git.reviewboard.kde.org/r/126779/

Regards
Comment 4 Kai Uwe Broulik 2016-01-19 22:33:23 UTC
Git commit 399143457b60dea463ec11aba13f5575439b21c1 by Kai Uwe Broulik, on behalf of Eduardo Lara.
Committed on 19/01/2016 at 22:31.
Pushed by broulik into branch 'master'.

Reset seek slider position when changing songs

The attached patch retrieves the position from the player when:
- a new maximum is set to the slider (most cases)
- the the slider is already at the end (when the same song is played again)

Note that adding 1 sec to the slider when the remaining is less than a second
sets the slider to maximum. Handling at that moment seemed to be too soon when
I tried it. Waiting for the next iteration looked to be a better transition

REVIEW: 126779
FIXED-IN: 5.6.0

M  +14   -4    applets/mediacontroller/contents/ui/ExpandedRepresentation.qml

http://commits.kde.org/plasma-workspace/399143457b60dea463ec11aba13f5575439b21c1