Commit b7e2590f authored by Sophie Kums's avatar Sophie Kums Committed by Nate Graham
Browse files

call Q_EMIT Seeked less frequently to reduce MPRIS spamming

CCBUG: 428957
parent 5a542521
Pipeline #42525 passed with stage
in 24 seconds
...@@ -208,14 +208,14 @@ void MediaPlayer2Player::setPropertyPosition(int newPositionInMs) ...@@ -208,14 +208,14 @@ void MediaPlayer2Player::setPropertyPosition(int newPositionInMs)
{ {
m_position = qlonglong(newPositionInMs) * 1000; m_position = qlonglong(newPositionInMs) * 1000;
Q_EMIT Seeked(m_position);
/* only sent new progress when it has advanced more than 1 % /* only sent new progress when it has advanced more than 1 %
* to limit DBus traffic * to limit DBus traffic
*/ */
const auto incrementalProgress = static_cast<double>(newPositionInMs - mPreviousProgressPosition) / m_audioPlayer->duration(); const auto incrementalProgress = static_cast<double>(newPositionInMs - mPreviousProgressPosition) / m_audioPlayer->duration();
if (mShowProgressOnTaskBar && (incrementalProgress > 0.01 || incrementalProgress < 0)) if (mShowProgressOnTaskBar && (incrementalProgress > 0.01 || incrementalProgress < 0))
{ {
Q_EMIT Seeked(m_position);
mPreviousProgressPosition = newPositionInMs; mPreviousProgressPosition = newPositionInMs;
QVariantMap parameters; QVariantMap parameters;
parameters.insert(QStringLiteral("progress-visible"), true); parameters.insert(QStringLiteral("progress-visible"), true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment