currentSourceChanged not emiited at the right time

Thierry Bastian thierry.bastian at trolltech.com
Wed Nov 21 16:39:23 CET 2007


Hello,

 

After discussing with Richard and Jens, we came to the conclusion that the
MediaObject::currentSourceChanged is not emitted at the right time.

What happens is that it is emitted in response to the aboutToFinish signal
emitted by the backend. The problem is that this is done before the actual
current source changes to leave some time to the backend to load the source.

 

So what could happen is that you're playing source1 and enqueue source2. You
want a gapless playback and the backend fire aboutToFinish 2 senconds before
the end of source 1.

The result of this is that Phonon::MediaObject calls setNextSource on the
backend, removes source2 from the queue and emits currentSourceChanged. This
will only be true in 2 seconds.

 

The attached patch fixes this by introducing a new signal
currentSourceChanged from the backend because only the backend accurately
knows when it changed the current source.

 

If anyone has a comment on the code, don't hesitate. It is binary
compatible, so no need to ask for a BIC.

 

Regards,

Thierry

 

PS: I would also like to change the way prefinishmarkreached is emitted
because it is quite tricky from the backend side to know if the current
source is the final one. This logic belongs to the frontend. With the
attached change this will be very easy to achieve.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/phonon-backends/attachments/20071121/bf7fc356/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: queue.patch
Type: application/octet-stream
Size: 2312 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/phonon-backends/attachments/20071121/bf7fc356/attachment.obj 


More information about the Phonon-backends mailing list