From 54e2295c214874a316d22eaedaf5c2db17b59df0 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 2 Jun 2023 01:29:05 +0200 Subject: Fix palette access and QMediaPlayer errors --- src/timeline/InputBar.cpp | 8 ++++---- src/ui/MxcMediaProxy.cpp | 15 ++++++++------- src/voip/CallManager.cpp | 8 ++++---- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 2fd2d21a..af974592 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -1033,12 +1033,12 @@ MediaUpload::MediaUpload(std::unique_ptr source_, } connect(mediaPlayer, -&QMediaPlayer::error, +&QMediaPlayer::errorOccurred, this, - [mediaPlayer]() { + [](QMediaPlayer::Error error, QString errorString) { nhlog::ui()->debug("Media player error {} and errorStr {}", - mediaPlayer->error(), - mediaPlayer->errorString().toStdString()); + error, + errorString.toStdString()); }); connect(mediaPlayer, &QMediaPlayer::mediaStatusChanged, diff --git a/src/ui/MxcMediaProxy.cpp b/src/ui/MxcMediaProxy.cpp index e10cb846..dd5d81a9 100644 --- a/src/ui/MxcMediaProxy.cpp +++ b/src/ui/MxcMediaProxy.cpp @@ -25,13 +25,14 @@ MxcMediaProxy::MxcMediaProxy(QObject *parent) { connect(this, &MxcMediaProxy::eventIdChanged, &MxcMediaProxy::startDownload); connect(this, &MxcMediaProxy::roomChanged, &MxcMediaProxy::startDownload); - connect(this, - &MxcMediaProxy::error, - [this]() { - nhlog::ui()->info("Media player error {} and errorStr {}", - error(), - this->errorString().toStdString()); - }); + connect(this, +&QMediaPlayer::errorOccurred, + this, + [](QMediaPlayer::Error error, QString errorString) { + nhlog::ui()->debug("Media player error {} and errorStr {}", + error, + errorString.toStdString()); + }); connect(this, &MxcMediaProxy::mediaStatusChanged, [this](QMediaPlayer::MediaStatus status) { nhlog::ui()->info("Media player status {} and error {}", status, this->error()); }); diff --git a/src/voip/CallManager.cpp b/src/voip/CallManager.cpp index 0ef14db9..9a610819 100644 --- a/src/voip/CallManager.cpp +++ b/src/voip/CallManager.cpp @@ -173,11 +173,11 @@ CallManager::CallManager(QObject *parent) }); connect(&player_, - &QMediaPlayer::error, + &QMediaPlayer::errorOccurred, this, - [this]() { + [this](QMediaPlayer::Error error, QString errorString) { stopRingtone(); - switch (player_.error()) { + switch (error) { case QMediaPlayer::FormatError: case QMediaPlayer::ResourceError: nhlog::ui()->error("WebRTC: valid ringtone file not found"); @@ -186,7 +186,7 @@ CallManager::CallManager(QObject *parent) nhlog::ui()->error("WebRTC: access to ringtone file denied"); break; default: - nhlog::ui()->error("WebRTC: unable to play ringtone"); + nhlog::ui()->error("WebRTC: unable to play ringtone, {}", errorString.toStdString()); break; } }); -- cgit 1.4.1