Phonon MediaObject's aboutToFinish() and phonon-vlc

Harald Sitter sitter.harald at gmail.com
Wed Oct 13 08:52:50 CEST 2010


Dearest Amarok Team,

Yesterday we had a bit of a bug hunt in #phonon and came to find the
cause of Amarok randomly stopping playback. The good news first: we
found the cause and have a sort-of workaround in phonon-vlc's git.

However.

The actual cause is a behaviour on your side that we do not consider a
very good idea. Your EngineController only will enqueue the next track
in the playlist when the Phonon MediaObject emits its aboutToFinish()
signal. This has two major disadvantages.
a) aforementioned signal can only be reliably emitted when the track
length is known (not the case for webstreams and of course if the
underlying library cannot reliably detect the length)
b) even though the documentation of Phonon says that the signal is
emitted reasonable time before the track ends, so that you can enqueue
a new track. That is however also not true if the track length is not
known or detected in a wrong way and you still anticipate the signal
to be fired.

So, to put that into a bit of context. The problem with phonon-vlc is
actually spanning across multiple levels.
1. VLC detects a wrong track length for certain OGG files, if someone
needs a test file, please poke me on IRC
2. Phonon-VLC does not emit aboutToFinish() if the track playback ends
at an unknown time.
3. Amarok depends on aboutToFinish() to be emitted in order to
progress in the playback.

jb is apparently working on 1., 2. we fixed by making sure
aboutToFinish() is emitted before finished() if not emitted yet, 3.
still needs fixing though.



More information about the Amarok-devel mailing list