Skip to content

Commit

Permalink
Hardware accelerated video decoding off by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Apr 19, 2022
1 parent bfe47a1 commit 1c5a3ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Telegram/SourceFiles/core/core_settings.cpp
Expand Up @@ -239,8 +239,9 @@ QByteArray Settings::serialize() const {
}

stream
<< qint32(_hardwareAcceleratedVideo ? 1 : 0)
<< qint32(_chatQuickAction);
<< qint32(0) // old hardwareAcceleratedVideo
<< qint32(_chatQuickAction)
<< qint32(_hardwareAcceleratedVideo ? 1 : 0);
}
return result;
}
Expand Down Expand Up @@ -514,11 +515,15 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
}
}
if (!stream.atEnd()) {
stream >> hardwareAcceleratedVideo;
qint32 legacyHardwareAcceleratedVideo = 0;
stream >> legacyHardwareAcceleratedVideo;
}
if (!stream.atEnd()) {
stream >> chatQuickAction;
}
if (!stream.atEnd()) {
stream >> hardwareAcceleratedVideo;
}
if (stream.status() != QDataStream::Ok) {
LOG(("App Error: "
"Bad data for Core::Settings::constructFromSerialized()"));
Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/core/core_settings.h
Expand Up @@ -792,7 +792,11 @@ class Settings final {
rpl::variable<Media::Player::OrderMode> _playerOrderMode;
bool _macWarnBeforeQuit = true;
std::vector<uint64> _accountsOrder;
#ifdef Q_OS_MAC
bool _hardwareAcceleratedVideo = true;
#else // Q_OS_MAC
bool _hardwareAcceleratedVideo = false;
#endif // Q_OS_MAC
HistoryView::DoubleClickQuickAction _chatQuickAction =
HistoryView::DoubleClickQuickAction();

Expand Down

0 comments on commit 1c5a3ae

Please sign in to comment.