From 589673e420dfeb62561360c5dcb440b56ab2ece9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 21 Jan 2022 18:01:33 +0300 Subject: [PATCH] Fix non-sticker Webm in media viewer. --- .../SourceFiles/media/view/media_view_overlay_opengl.cpp | 9 ++++++--- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp index 4055b0f9b..f07f0cecd 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_opengl.cpp @@ -187,10 +187,13 @@ void OverlayWidget::RendererGL::paintTransformedVideoFrame( const auto data = _owner->videoFrameWithInfo(); if (data.format == Streaming::FrameFormat::None) { return; - } - if (data.format == Streaming::FrameFormat::ARGB32) { + } else if (data.format == Streaming::FrameFormat::ARGB32) { Assert(!data.original.isNull()); - paintTransformedStaticContent(data.original, geometry, false, false); + paintTransformedStaticContent( + data.original, + geometry, + data.alpha, + data.alpha); return; } Assert(data.format == Streaming::FrameFormat::YUV420); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 4496e04de..b7690782a 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -611,6 +611,7 @@ Streaming::FrameWithInfo OverlayWidget::videoFrameWithInfo() const { .original = _streamed->instance.info().video.cover, .format = Streaming::FrameFormat::ARGB32, .index = -2, + .alpha = _streamed->instance.info().video.alpha, }; } @@ -656,7 +657,9 @@ bool OverlayWidget::opaqueContentShown() const { return contentShown() && (!_staticContentTransparent || !_document - || (!_document->isVideoMessage() && !_document->sticker())); + || (!_document->isVideoMessage() + && !_document->sticker() + && (!_streamed || !_streamed->instance.info().video.alpha))); } void OverlayWidget::clearStreaming(bool savePosition) {