From 775d5b6dccf48c3310aed044b9022fc3d0a3518f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 Feb 2020 16:44:08 +0400 Subject: [PATCH] Use 64 byte alignment for ffmpeg frames. Fixes #7225. --- Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp | 3 ++- Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp index a03d191ca..6cb988a28 100644 --- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp +++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp @@ -23,7 +23,8 @@ extern "C" { namespace FFmpeg { namespace { -constexpr auto kAlignImageBy = 16; +// See https://github.com/telegramdesktop/tdesktop/issues/7225 +constexpr auto kAlignImageBy = 64; constexpr auto kImageFormat = QImage::Format_ARGB32_Premultiplied; constexpr auto kMaxScaleByAspectRatio = 16; constexpr auto kAvioBlockSize = 4096; diff --git a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp index 68b56a388..e8fda438a 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp +++ b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp @@ -16,8 +16,10 @@ namespace Clip { namespace internal { namespace { -constexpr int kSkipInvalidDataPackets = 10; -constexpr int kAlignImageBy = 16; +constexpr auto kSkipInvalidDataPackets = 10; + +// See https://github.com/telegramdesktop/tdesktop/issues/7225 +constexpr auto kAlignImageBy = 64; void alignedImageBufferCleanupHandler(void *data) { auto buffer = static_cast(data);