about MediaSource::Empty

Luc Menut Luc.Menut at supagro.inra.fr
Wed Nov 11 23:55:50 CET 2009


Hi all,

Matthias Kretz a écrit :
> Hi all,
> 
> sorry for not looking at this earlier.
> 

thanks for your reply, and for your explanations.

> Anyway as you figured out already MediaSource::Empty is required to allow 
> applications to tell Phonon more about the state of things. I.e. if a 
> MediaObject has a file/URL set it is required to react as fast as possible on 
> a call to play(). Therefore this is not the best state to leave an inactive 
> MediaObject in, and that's where Empty got introduced. It allows to unset the 
> file/URL.
> 
> Now when that happens - the unsetting - MediaObject should go into the same 
> state as it is in when you construct it and have not called any other 
> functions on it. Which should be LoadingState. Any backend that does something 
> else has to be fixed to go to LoadingState (and it seems even xine does that 
> wrong): http://api.kde.org/kdesupport-api/kdesupport-
> apidocs/phonon/html/namespacePhonon.html#a506d3735ede59def9354fedfc4026db7 
> says StoppedState == "The Player has a valid media file loaded and is ready 
> for playing." (which is even more valid for PausedState).
> 
> IIUC you fixed the issue by allowing stop to be called with Empty and call 
> stop from the knotify4 code, right?

Yes, for Mandriva 2010.0, we use these 2 patches:
https://bzattachment.mandriva.com/attachment.cgi?id=15401
https://bzattachment.mandriva.com/attachment.cgi?id=15402

as we were near the final release and I didn't know precisely what
should be done by the backend with MediaSource::Empty, I tried to fix
the bug without too much changes, to avoid the regressions.

> Instead all backends should be fixed to understand MediaSource::Empty to clean 
> up and go into the initial LoadingState.

well, TODO ;-)


Regards,
      Luc


-- 
Luc Menut



More information about the Phonon-backends mailing list