Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libdmusic/player/qtplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void QtPlayer::setFadeInOutFactor(double fadeInOutFactor)
{
qCDebug(dmMusic) << "Set fade in/out factor";
init();
m_audioOutput->setVolume(static_cast<int>(10 * fadeInOutFactor));
m_audioOutput->setVolume(qBound(0.0, static_cast<qreal>(m_volume) / 100.0 * fadeInOutFactor, 1.0));
}

void QtPlayer::setVolume(int volume)
Expand All @@ -209,7 +209,7 @@ void QtPlayer::setVolume(int volume)
init();
qCDebug(dmMusic) << "Setting volume to:" << volume;
m_volume = volume;
m_audioOutput->setVolume(volume);
m_audioOutput->setVolume(volume / 100.0);
}

int QtPlayer::getVolume()
Expand Down
Loading