[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [phonon-backend-gstreamer] [Bug 311193] Switching equalizer presets from/to Inactive resets song pla
From:       A_Hooman_Bean <jss () mensa ! org ! au>
Date:       2015-02-24 22:36:02
Message-ID: bug-311193-17878-i8ojBM28KM () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=311193

--- Comment #26 from A_Hooman_Bean <jss@mensa.org.au> ---
13 lines of code and the problem is solved:

EngineController.h :
    qint64 trackPositionMsBeforeToggle;
    bool NeedToSeekAfterEqToggled = false;
Insert above 2 lines in public section at line 60

EngineController.cpp :
      if ( NeedToSeekAfterEqToggled ) {
    NeedToSeekAfterEqToggled = false;
    seekTo(trackPositionMsBeforeToggle);
    warning() << "Backend reset track position. Had to seek back to correct
track position when EQ was enabled/disabled: " << trackPositionMsBeforeToggle
<< " ms.";
      }
Insert above 5 lines at line 1100, just after:
    else if( newState == Phonon::PlayingState )
    {

EqualizerDialog.cpp, in modify toggleEqualizer method:
    qint64 TimeDifferenceMs;
    The::engineController()->trackPositionMsBeforeToggle =
The::engineController()->trackPositionMs();
Insert above 2 lines in  at line 330, just before applyEqualizerPreset

  TimeDifferenceMs = The::engineController()->trackPositionMs() -
The::engineController()->trackPositionMsBeforeToggle;
    if( TimeDifferenceMs < 0  ) { //could make comparison  vs some small number
of ms, if backend might introduce just a small amount of rewind jitter on
toggle.
      The::engineController()->NeedToSeekAfterEqToggled = true;
    }
Insert above 4 lines in  at line 338, just after applyEqualizerPreset

With the above fix there is still a momentary stutter when the equalizer is
toggled, but the problem is fixed as well as it can be, given the gstreamer
backend is so riddled with deadlocks that Phonon has to reset it.
And if the underlying problem in phonon/gstreamer is fixed at some point in the
distant future, then the above code just won't be invoked.

I look forward to seeing this fix in the next Amarok release.

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic