summaryrefslogtreecommitdiff
path: root/net-im/telegram-desktop/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /net-im/telegram-desktop/files
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'net-im/telegram-desktop/files')
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch2
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch80
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch2
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch72
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch21
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch262
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch25
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch14
8 files changed, 390 insertions, 88 deletions
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch b/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch
index 5351a808ec4c..8563ee5fdca0 100644
--- a/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch
@@ -1,5 +1,3 @@
-Index: tdesktop-2.7.1-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp
-===================================================================
--- tdesktop-2.7.1-full.orig/Telegram/SourceFiles/platform/linux/specific_linux.cpp
+++ tdesktop-2.7.1-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp
@@ -754,10 +754,12 @@ void InstallLauncher(bool force) {
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch
deleted file mode 100644
index a143071401a9..000000000000
--- a/net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-Index: tdesktop-2.7.3-full/Telegram/lib_webview/CMakeLists.txt
-===================================================================
---- tdesktop-2.7.3-full.orig/Telegram/lib_webview/CMakeLists.txt
-+++ tdesktop-2.7.3-full/Telegram/lib_webview/CMakeLists.txt
-@@ -116,7 +116,7 @@ if (WIN32)
- desktop-app::lib_webview_winrt
- )
- elseif (LINUX)
-- if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
-+ if (NOT DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION)
- find_package(PkgConfig REQUIRED)
-
- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
-Index: tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
-===================================================================
---- tdesktop-2.7.3-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
-+++ tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
-@@ -11,14 +11,14 @@
- namespace Webview {
-
- Available Availability() {
--#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#ifndef DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return WebKit2Gtk::Availability();
--#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#else // !DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return Available{
- .error = Available::Error::NoGtkOrWebkit2Gtk,
- .details = "This feature was disabled at build time.",
- };
--#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#endif // DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- }
-
- bool SupportsEmbedAfterCreate() {
-@@ -26,11 +26,11 @@ bool SupportsEmbedAfterCreate() {
- }
-
- std::unique_ptr<Interface> CreateInstance(Config config) {
--#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#ifndef DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return WebKit2Gtk::CreateInstance(std::move(config));
--#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#else // !DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return nullptr;
--#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#endif // DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- }
-
- } // namespace Webview
-Index: tdesktop-2.7.3-full/cmake/options.cmake
-===================================================================
---- tdesktop-2.7.3-full.orig/cmake/options.cmake
-+++ tdesktop-2.7.3-full/cmake/options.cmake
-@@ -49,6 +49,13 @@ if (DESKTOP_APP_DISABLE_GTK_INTEGRATION)
- )
- endif()
-
-+if (DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION)
-+ target_compile_definitions(common_options
-+ INTERFACE
-+ DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
-+ )
-+endif()
-+
- if (DESKTOP_APP_USE_PACKAGED)
- target_compile_definitions(common_options
- INTERFACE
-Index: tdesktop-2.7.3-full/cmake/variables.cmake
-===================================================================
---- tdesktop-2.7.3-full.orig/cmake/variables.cmake
-+++ tdesktop-2.7.3-full/cmake/variables.cmake
-@@ -32,6 +32,7 @@ option(DESKTOP_APP_DISABLE_DBUS_INTEGRAT
- option(DESKTOP_APP_DISABLE_X11_INTEGRATION "Disable all code for X11 integration (Linux only)." OFF)
- option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration (Linux only)." OFF)
- option(DESKTOP_APP_DISABLE_GTK_INTEGRATION "Disable all code for GTK integration (Linux only)." OFF)
-+option(DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION "Disable all code for WebkitGTK integration (Linux only)." OFF)
- option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." OFF)
- option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." ${no_special_target})
- option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF)
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch b/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch
index 2f06bda3272a..491a8cd3e1dc 100644
--- a/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch
@@ -1,5 +1,3 @@
-Index: tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
-===================================================================
--- tdesktop-2.7.3-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
+++ tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
@@ -12,6 +12,7 @@ extern "C" {
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch
new file mode 100644
index 000000000000..e54aca2ffa05
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch
@@ -0,0 +1,72 @@
+--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/CMakeLists.txt
++++ tdesktop-2.7.4-full/Telegram/lib_webview/CMakeLists.txt
+@@ -116,7 +116,7 @@
+ desktop-app::lib_webview_winrt
+ )
+ elseif (LINUX)
+- if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
++ if (NOT DESKTOP_APP_DISABLE_WEBKIT)
+ find_package(PkgConfig REQUIRED)
+
+ if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
++++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
+@@ -11,14 +11,14 @@
+ namespace Webview {
+
+ Available Availability() {
+-#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#ifndef DESKTOP_APP_DISABLE_WEBKIT
+ return WebKit2Gtk::Availability();
+-#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#else // !DESKTOP_APP_DISABLE_WEBKIT
+ return Available{
+ .error = Available::Error::NoGtkOrWebkit2Gtk,
+ .details = "This feature was disabled at build time.",
+ };
+-#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#endif // DESKTOP_APP_DISABLE_WEBKIT
+ }
+
+ bool SupportsEmbedAfterCreate() {
+@@ -26,11 +26,11 @@
+ }
+
+ std::unique_ptr<Interface> CreateInstance(Config config) {
+-#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#ifndef DESKTOP_APP_DISABLE_WEBKIT
+ return WebKit2Gtk::CreateInstance(std::move(config));
+-#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#else // !DESKTOP_APP_DISABLE_WEBKIT
+ return nullptr;
+-#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#endif // DESKTOP_APP_DISABLE_WEBKIT
+ }
+
+ } // namespace Webview
+--- tdesktop-2.7.4-full.orig/cmake/options.cmake
++++ tdesktop-2.7.4-full/cmake/options.cmake
+@@ -49,6 +49,13 @@
+ )
+ endif()
+
++if (DESKTOP_APP_DISABLE_WEBKIT)
++ target_compile_definitions(common_options
++ INTERFACE
++ DESKTOP_APP_DISABLE_WEBKIT
++ )
++endif()
++
+ if (DESKTOP_APP_USE_PACKAGED)
+ target_compile_definitions(common_options
+ INTERFACE
+--- tdesktop-2.7.4-full.orig/cmake/variables.cmake
++++ tdesktop-2.7.4-full/cmake/variables.cmake
+@@ -38,6 +38,7 @@
+ option(DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES "Bundle recommended Qt platform themes for self-contained packages. (Linux only)" ${DESKTOP_APP_USE_PACKAGED_LAZY})
+ option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF)
+ option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target})
++option(DESKTOP_APP_DISABLE_WEBKIT "Disable WebkitGTK library (Linux only)." OFF)
+ option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target})
+ option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})
+ option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF)
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch
new file mode 100644
index 000000000000..941a4ecc09cb
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch
@@ -0,0 +1,21 @@
+--- tdesktop-2.7.4-full.orig/Telegram/SourceFiles/platform/linux/notifications_manager_linux_dummy.cpp
++++ tdesktop-2.7.4-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux_dummy.cpp
+@@ -13,15 +13,15 @@
+ namespace Platform {
+ namespace Notifications {
+
+-bool SkipAudio() {
++bool SkipAudioForCustom() {
+ return false;
+ }
+
+-bool SkipToast() {
++bool SkipToastForCustom() {
+ return false;
+ }
+
+-bool SkipFlashBounce() {
++bool SkipFlashBounceForCustom() {
+ return false;
+ }
+
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch
new file mode 100644
index 000000000000..41e447989cb2
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch
@@ -0,0 +1,262 @@
+From 71deaa48afab2bcf9df67b9b347b1f44aad3a9ce Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail@gmail.com>
+Date: Thu, 13 May 2021 15:17:54 +0400
+Subject: [PATCH] Don't crash on voice recording error.
+
+Fixes #16217.
+---
+ .../media/audio/media_audio_capture.cpp | 89 +++++++++++--------
+ 1 file changed, 54 insertions(+), 35 deletions(-)
+
+diff --git a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+index a5965e0d1988..deb2474d7891 100644
+--- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
++++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+@@ -47,17 +47,17 @@ class Instance::Inner final : public QObject {
+ void start(Fn<void(Update)> updated, Fn<void()> error);
+ void stop(Fn<void(Result&&)> callback = nullptr);
+
+- void timeout();
+-
+ private:
+- void processFrame(int32 offset, int32 framesize);
++ void process();
++
++ [[nodiscard]] bool processFrame(int32 offset, int32 framesize);
+ void fail();
+
+- void writeFrame(AVFrame *frame);
++ [[nodiscard]] bool writeFrame(AVFrame *frame);
+
+ // Writes the packets till EAGAIN is got from av_receive_packet()
+ // Returns number of packets written or -1 on error
+- int writePackets();
++ [[nodiscard]] int writePackets();
+
+ Fn<void(Update)> _updated;
+ Fn<void()> _error;
+@@ -150,6 +150,7 @@ struct Instance::Inner::Private {
+ AVCodec *codec = nullptr;
+ AVCodecContext *codecContext = nullptr;
+ bool opened = false;
++ bool processing = false;
+
+ int srcSamples = 0;
+ int dstSamples = 0;
+@@ -217,7 +218,7 @@ struct Instance::Inner::Private {
+
+ Instance::Inner::Inner(QThread *thread)
+ : d(std::make_unique<Private>())
+-, _timer(thread, [=] { timeout(); }) {
++, _timer(thread, [=] { process(); }) {
+ moveToThread(thread);
+ }
+
+@@ -226,10 +227,10 @@ Instance::Inner::~Inner() {
+ }
+
+ void Instance::Inner::fail() {
+- Expects(_error != nullptr);
+-
+ stop();
+- _error();
++ if (const auto error = base::take(_error)) {
++ InvokeQueued(this, error);
++ }
+ }
+
+ void Instance::Inner::start(Fn<void(Update)> updated, Fn<void()> error) {
+@@ -384,13 +385,21 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ }
+ _timer.cancel();
+
+- if (d->device) {
++ const auto needResult = (callback != nullptr);
++ const auto hadDevice = (d->device != nullptr);
++ if (hadDevice) {
+ alcCaptureStop(d->device);
+- timeout(); // get last data
++ if (d->processing) {
++ Assert(!needResult); // stop in the middle of processing - error.
++ } else {
++ process(); // get last data
++ }
++ alcCaptureCloseDevice(d->device);
++ d->device = nullptr;
+ }
+
+ // Write what is left
+- if (!_captured.isEmpty()) {
++ if (needResult && !_captured.isEmpty()) {
+ auto fadeSamples = kCaptureFadeInDuration * kCaptureFrequency / 1000;
+ auto capturedSamples = static_cast<int>(_captured.size() / sizeof(short));
+ if ((_captured.size() % sizeof(short)) || (d->fullSamples + capturedSamples < kCaptureFrequency) || (capturedSamples < fadeSamples)) {
+@@ -414,11 +423,13 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+
+ int32 framesize = d->srcSamples * d->codecContext->channels * sizeof(short), encoded = 0;
+ while (_captured.size() >= encoded + framesize) {
+- processFrame(encoded, framesize);
++ if (!processFrame(encoded, framesize)) {
++ break;
++ }
+ encoded += framesize;
+ }
+- writeFrame(nullptr); // drain the codec
+- if (encoded != _captured.size()) {
++ // Drain the codec.
++ if (!writeFrame(nullptr) || encoded != _captured.size()) {
+ d->fullSamples = 0;
+ d->dataPos = 0;
+ d->data.clear();
+@@ -436,14 +447,14 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ _captured = QByteArray();
+
+ // Finish stream
+- if (d->device) {
++ if (needResult && hadDevice) {
+ av_write_trailer(d->fmtContext);
+ }
+
+ QByteArray result = d->fullSamples ? d->data : QByteArray();
+ VoiceWaveform waveform;
+ qint32 samples = d->fullSamples;
+- if (samples && !d->waveform.isEmpty()) {
++ if (needResult && samples && !d->waveform.isEmpty()) {
+ int64 count = d->waveform.size(), sum = 0;
+ if (count >= Player::kWaveformSamplesCount) {
+ QVector<uint16> peaks;
+@@ -472,11 +483,7 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ }
+ }
+ }
+- if (d->device) {
+- alcCaptureStop(d->device);
+- alcCaptureCloseDevice(d->device);
+- d->device = nullptr;
+-
++ if (hadDevice) {
+ if (d->codecContext) {
+ avcodec_free_context(&d->codecContext);
+ d->codecContext = nullptr;
+@@ -528,12 +535,17 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ d->waveform.clear();
+ }
+
+- if (callback) {
++ if (needResult) {
+ callback({ result, waveform, samples });
+ }
+ }
+
+-void Instance::Inner::timeout() {
++void Instance::Inner::process() {
++ Expects(!d->processing);
++
++ d->processing = true;
++ const auto guard = gsl::finally([&] { d->processing = false; });
++
+ if (!d->device) {
+ _timer.cancel();
+ return;
+@@ -582,7 +594,9 @@ void Instance::Inner::timeout() {
+ // Write frames
+ int32 framesize = d->srcSamples * d->codecContext->channels * sizeof(short), encoded = 0;
+ while (uint32(_captured.size()) >= encoded + framesize + fadeSamples * sizeof(short)) {
+- processFrame(encoded, framesize);
++ if (!processFrame(encoded, framesize)) {
++ return;
++ }
+ encoded += framesize;
+ }
+
+@@ -597,13 +611,13 @@ void Instance::Inner::timeout() {
+ }
+ }
+
+-void Instance::Inner::processFrame(int32 offset, int32 framesize) {
++bool Instance::Inner::processFrame(int32 offset, int32 framesize) {
+ // Prepare audio frame
+
+ if (framesize % sizeof(short)) { // in the middle of a sample
+ LOG(("Audio Error: Bad framesize in writeFrame() for capture, framesize %1, %2").arg(framesize));
+ fail();
+- return;
++ return false;
+ }
+ auto samplesCnt = static_cast<int>(framesize / sizeof(short));
+
+@@ -650,7 +664,7 @@ void Instance::Inner::processFrame(int32 offset, int32 framesize) {
+ if ((res = av_samples_alloc(d->dstSamplesData, 0, d->codecContext->channels, d->dstSamples, d->codecContext->sample_fmt, 1)) < 0) {
+ LOG(("Audio Error: Unable to av_samples_alloc for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ fail();
+- return;
++ return false;
+ }
+ d->dstSamplesSize = av_samples_get_buffer_size(0, d->codecContext->channels, d->maxDstSamples, d->codecContext->sample_fmt, 0);
+ }
+@@ -658,7 +672,7 @@ void Instance::Inner::processFrame(int32 offset, int32 framesize) {
+ if ((res = swr_convert(d->swrContext, d->dstSamplesData, d->dstSamples, (const uint8_t **)srcSamplesData, d->srcSamples)) < 0) {
+ LOG(("Audio Error: Unable to swr_convert for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ fail();
+- return;
++ return false;
+ }
+
+ // Write audio frame
+@@ -670,45 +684,50 @@ void Instance::Inner::processFrame(int32 offset, int32 framesize) {
+
+ avcodec_fill_audio_frame(frame, d->codecContext->channels, d->codecContext->sample_fmt, d->dstSamplesData[0], d->dstSamplesSize, 0);
+
+- writeFrame(frame);
++ if (!writeFrame(frame)) {
++ return false;
++ }
+
+ d->fullSamples += samplesCnt;
+
+ av_frame_free(&frame);
++ return true;
+ }
+
+-void Instance::Inner::writeFrame(AVFrame *frame) {
++bool Instance::Inner::writeFrame(AVFrame *frame) {
+ int res = 0;
+ char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
+
+ res = avcodec_send_frame(d->codecContext, frame);
+ if (res == AVERROR(EAGAIN)) {
+- int packetsWritten = writePackets();
++ const auto packetsWritten = writePackets();
+ if (packetsWritten < 0) {
+ if (frame && packetsWritten == AVERROR_EOF) {
+ LOG(("Audio Error: EOF in packets received when EAGAIN was got in avcodec_send_frame()"));
+ fail();
+ }
+- return;
++ return false;
+ } else if (!packetsWritten) {
+ LOG(("Audio Error: No packets received when EAGAIN was got in avcodec_send_frame()"));
+ fail();
+- return;
++ return false;
+ }
+ res = avcodec_send_frame(d->codecContext, frame);
+ }
+ if (res < 0) {
+ LOG(("Audio Error: Unable to avcodec_send_frame for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ fail();
+- return;
++ return false;
+ }
+
+ if (!frame) { // drain
+ if ((res = writePackets()) != AVERROR_EOF) {
+ LOG(("Audio Error: not EOF in packets received when draining the codec, result %1").arg(res));
+ fail();
++ return false;
+ }
+ }
++ return true;
+ }
+
+ int Instance::Inner::writePackets() {
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch
new file mode 100644
index 000000000000..4156956032d4
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch
@@ -0,0 +1,25 @@
+From a8807bc915f2439acc7c84f06d931d96d6ca602a Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail@gmail.com>
+Date: Thu, 13 May 2021 15:33:42 +0400
+Subject: [PATCH] Fix voice recoding with FFmpeg 4.4.
+
+Fixes #16217.
+---
+ Telegram/SourceFiles/media/audio/media_audio_capture.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+index deb2474d789..d129168783d 100644
+--- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
++++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+@@ -679,6 +679,10 @@ bool Instance::Inner::processFrame(int32 offset, int32 framesize) {
+
+ AVFrame *frame = av_frame_alloc();
+
++ frame->format = d->codecContext->sample_fmt;
++ frame->channels = d->codecContext->channels;
++ frame->channel_layout = d->codecContext->channel_layout;
++ frame->sample_rate = d->codecContext->sample_rate;
+ frame->nb_samples = d->dstSamples;
+ frame->pts = av_rescale_q(d->fullSamples, AVRational { 1, d->codecContext->sample_rate }, d->codecContext->time_base);
+
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch
index 0188eaf76f8a..7f4b3f2601f5 100644
--- a/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch
@@ -1,5 +1,13 @@
-Index: tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.cpp
-===================================================================
+--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp
++++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp
+@@ -6,6 +6,7 @@
+ //
+ #include "webview/platform/linux/webview_linux_webkit_gtk.h"
+
++#include "base/optional.h"
+ #include "base/platform/linux/base_linux_gtk_integration.h"
+ #include "base/platform/linux/base_linux_gtk_integration_p.h"
+
--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/webview_embed.cpp
+++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.cpp
@@ -14,7 +14,6 @@
@@ -10,8 +18,6 @@ Index: tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.cpp
namespace Webview {
namespace {
-Index: tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.h
-===================================================================
--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/webview_embed.h
+++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.h
@@ -9,6 +9,8 @@