]> Some of my projects - aniplayer.git/commitdiff
Only save frames when they are requested
authorAPTX <marek321@gmail.com>
Sun, 25 Nov 2018 10:02:29 +0000 (19:02 +0900)
committerAPTX <marek321@gmail.com>
Sun, 25 Nov 2018 10:02:29 +0000 (19:02 +0900)
core/player.cpp

index 6b7a5551c43a2e748489c611f5c67f8a8ebf5fb1..73654fe3be53ad019fd47c15c441439739876edd 100644 (file)
@@ -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;