From: APTX Date: Sun, 25 Nov 2018 10:02:29 +0000 (+0900) Subject: Only save frames when they are requested X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=689ec8456dea92938aa2941ca2becd5d0b230f7f;p=aniplayer.git Only save frames when they are requested --- diff --git a/core/player.cpp b/core/player.cpp index 6b7a555..73654fe 100644 --- a/core/player.cpp +++ b/core/player.cpp @@ -121,7 +121,11 @@ QAbstractItemModel *Player::annotationModel() const { return m_annotationModel; } -bool Player::shouldSaveFramesToImage() const { return true; } +bool Player::shouldSaveFramesToImage() const { + // Only save the frames if anyone requests them. + const auto &receiverCount = receivers(SIGNAL(frameChanged(QImage))); + return receiverCount != 0; +} void Player::newFrame(const QImage &image) { m_lastFrame = image;