From 846cabeda546a9fa89b45c5ee07d6ecad6e33e8c Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 20 Jan 2022 18:15:08 +0300 Subject: [PATCH] Premultiply YUVA alpha in FFMpegReaderImplementation. --- Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp index 553b1d6dae..2cfb6f4d08 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp +++ b/Telegram/SourceFiles/media/clip/media_clip_ffmpeg.cpp @@ -240,7 +240,7 @@ bool FFMpegReaderImplementation::renderFrame(QImage &to, bool &hasAlpha, const Q int toLinesize[AV_NUM_DATA_POINTERS] = { int(to.bytesPerLine()), 0 }; sws_scale(_swsContext, _frame->data, _frame->linesize, 0, _frame->height, toData, toLinesize); } - if (bgra) { + if (hasAlpha) { FFmpeg::PremultiplyInplace(to); } if (_rotation != Rotation::None) {