Juk & kdemm power management inhibition
Harald Sitter
sitter at kde.org
Thu May 23 14:52:48 BST 2013
On Thu, May 23, 2013 at 3:15 PM, James Daniel Smith <smithjd15 at gmail.com>wrote:
> Here is a more robust version of the patch, made with the VLC backend in
> mind. Juk has a problem vis. sleepInhibit with the way Phonon
> stateChanged handles the VLC backend vs the GStreamer backend which
> seemed to work fine on both play and stop / pause instances (again vis.
> sleepInhibit)
>
that's because (from v3)...
if(oldstate != Phonon::PlayingState)
...is a bogus statement as BufferingState is concurrent to Play/Pause. so
you would have had to track the original oldstate whenever Phonon goes into
buffering.
the correct handling in general should be:
- inhibit when going into Playing and there is no existing inhibition
- lift inhibition when going into Paused/Stopped/Loading/Error and there is
an existing inhibition
so the general idea should be to lift/establish inhibition regardless of
the playback state history but the *current* state and whether or not an
inihibition is present already. that being said v4 is still wrong as it
only lifts the inhibition when going into stopped and paused.
for example:
#define NOCOOKIE -1
switch(state) {
case Paused|Stopped|Loading|Error:
if (cookie != NOCOOKIE) {
stopSupressionBlahBlah();
cookie = NOCOOKIE;
}
break;
case Playing:
if (cookie == NOCOOKIE)
cookie = beingSupressionBlahBlah();
break;
}
also please consider using reviewboard
http://techbase.kde.org/Development/Review_Board
HS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20130523/4014968d/attachment.htm>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia
More information about the kde-multimedia
mailing list