From 361b99b0c9c9f69bc8479a4413dbe62113405734 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 27 Jul 2020 18:19:26 +0400 Subject: [PATCH] Use threaded decoding in ffmpeg streaming. --- Telegram/SourceFiles/core/utils.cpp | 4 ---- Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp | 1 + Telegram/SourceFiles/stdafx.h | 8 ++++++++ Telegram/lib_base | 2 +- Telegram/lib_crl | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/core/utils.cpp b/Telegram/SourceFiles/core/utils.cpp index 8066bc67d..d989ff25e 100644 --- a/Telegram/SourceFiles/core/utils.cpp +++ b/Telegram/SourceFiles/core/utils.cpp @@ -32,10 +32,6 @@ extern "C" { #include -#ifdef small -#undef small -#endif // small - uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; // Base types compile-time check diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp index 6cb988a28..5221c92da 100644 --- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp +++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp @@ -175,6 +175,7 @@ CodecPointer MakeCodecPointer(not_null stream) { return {}; } av_codec_set_pkt_timebase(context, stream->time_base); + av_opt_set(context, "threads", "auto", 0); av_opt_set_int(context, "refcounted_frames", 1, 0); const auto codec = avcodec_find_decoder(context->codec_id); diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index ca0f0098d..563fb11a5 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -83,6 +83,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #define __STDC_FORMAT_MACROS #endif // Q_OS_UNIX +// Remove 'small' macro definition. +#ifdef Q_OS_WIN +#include +#ifdef small +#undef small +#endif // small +#endif // Q_OS_WIN + #include #include #include diff --git a/Telegram/lib_base b/Telegram/lib_base index 6a78e454e..623439a33 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 6a78e454e5bd61133b3d6c9f8d64fbad00f17618 +Subproject commit 623439a33a4c3e70251d62566f064c812e545980 diff --git a/Telegram/lib_crl b/Telegram/lib_crl index 661ac4f6b..bb8547bba 160000 --- a/Telegram/lib_crl +++ b/Telegram/lib_crl @@ -1 +1 @@ -Subproject commit 661ac4f6bdf8991e7d6cac176d32338ac025b637 +Subproject commit bb8547bba703e53ab46cd6cd009c48adabaa1823