summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-01-08 01:30:12 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2024-01-08 01:30:12 +0100
commit8214e8dcf2761e57e98341435571c0bc57a47e5d (patch)
tree46f445ec2e0dec7d1a4046e2f4c6701005a1fa79
parentFix lag when media messages are shown and fix media controls (diff)
downloadnheko-8214e8dcf2761e57e98341435571c0bc57a47e5d.tar.xz
Make clazy happy
-rw-r--r--src/ui/MxcMediaProxy.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/ui/MxcMediaProxy.cpp b/src/ui/MxcMediaProxy.cpp
index 3d486f6a..4127121b 100644
--- a/src/ui/MxcMediaProxy.cpp
+++ b/src/ui/MxcMediaProxy.cpp
@@ -29,22 +29,24 @@ MxcMediaProxy::MxcMediaProxy(QObject *parent)
                              static_cast<int>(error),
                              errorString.toStdString());
       });
-    connect(this, &MxcMediaProxy::mediaStatusChanged, [this](QMediaPlayer::MediaStatus status) {
-        nhlog::ui()->info("Media player status {} and error {}",
-                          static_cast<int>(status),
-                          static_cast<int>(this->error()));
-    });
-    connect(this, &MxcMediaProxy::playbackStateChanged, [this](QMediaPlayer::PlaybackState status) {
-        // We only set the output when starting the playback because otherwise the audio device
-        // lookup takes about 500ms, which causes a lot of stutter...
-        if (status == QMediaPlayer::PlayingState && !audioOutput()) {
-            nhlog::ui()->debug("Set audio output");
-            auto newOut = new QAudioOutput(this);
-            newOut->setMuted(muted_);
-            newOut->setVolume(volume_);
-            setAudioOutput(newOut);
-        }
-    });
+    connect(
+      this, &MxcMediaProxy::mediaStatusChanged, this, [this](QMediaPlayer::MediaStatus status) {
+          nhlog::ui()->info("Media player status {} and error {}",
+                            static_cast<int>(status),
+                            static_cast<int>(this->error()));
+      });
+    connect(
+      this, &MxcMediaProxy::playbackStateChanged, this, [this](QMediaPlayer::PlaybackState status) {
+          // We only set the output when starting the playback because otherwise the audio device
+          // lookup takes about 500ms, which causes a lot of stutter...
+          if (status == QMediaPlayer::PlayingState && !audioOutput()) {
+              nhlog::ui()->debug("Set audio output");
+              auto newOut = new QAudioOutput(this);
+              newOut->setMuted(muted_);
+              newOut->setVolume(volume_);
+              setAudioOutput(newOut);
+          }
+      });
     connect(this, &MxcMediaProxy::metaDataChanged, [this]() { emit orientationChanged(); });
 
     connect(ChatPage::instance()->timelineManager()->rooms(),