<div dir="ltr">On Thu, May 23, 2013 at 3:15 PM, James Daniel Smith <span dir="ltr"><<a href="mailto:smithjd15@gmail.com" target="_blank">smithjd15@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Here is a more robust version of the patch, made with the VLC backend in<br>


mind. Juk has a problem vis. sleepInhibit with the way Phonon<br>
stateChanged handles the VLC backend vs the GStreamer backend which<br>
seemed to work fine on both play and stop / pause instances (again vis.<br>
sleepInhibit)<br></blockquote><div><br></div><div style>that's because (from v3)...</div><div><br></div><div style>if(oldstate != Phonon::PlayingState)</div><div style><br></div><div style>...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.</div>

<div style><br></div><div style>the correct handling in general should be:</div><div style>- inhibit when going into Playing and there is no existing inhibition</div><div style>- lift inhibition when going into Paused/Stopped/Loading/Error and there is an existing inhibition</div>

<div style><br></div><div style>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.</div>

<div style><br></div><div style>for example:</div><div style><br></div><div style>#define NOCOOKIE -1</div><div style>switch(state) {</div><div style>case Paused|Stopped|Loading|Error:</div><div style>if (cookie != NOCOOKIE) {</div>

<div style> stopSupressionBlahBlah();</div><div style> cookie = NOCOOKIE;</div><div style>}</div><div style>break;</div><div style>case Playing:</div><div style>if (cookie == NOCOOKIE)</div><div style> cookie = beingSupressionBlahBlah();</div>

<div style>break;</div><div style>}</div><div style><br></div><div style>also please consider using reviewboard</div><div style><a href="http://techbase.kde.org/Development/Review_Board">http://techbase.kde.org/Development/Review_Board</a><br>

</div><div style><br></div><div style>HS</div></div></div></div>