diff options
author | gao_cai_sheng | 2022-03-12 21:31:05 +0800 |
---|---|---|
committer | gao_cai_sheng | 2022-03-12 21:31:05 +0800 |
commit | 8ebe549b95c5fe4c80e3ed64a1ed3b601a35d4fc (patch) | |
tree | 2f8c9664c5ffd885991cd46723c148bdb331bc7e /fix-ffmpeg-build-for-tgcalls.patch | |
parent | 9221b90b4d0358bd73e1b9867c517ae133697a09 (diff) | |
download | aur-8ebe549b95c5fe4c80e3ed64a1ed3b601a35d4fc.tar.gz |
misc: replace git am with patch
Signed-off-by: gao_cai_sheng <qwq233@qwq2333.top>
Diffstat (limited to 'fix-ffmpeg-build-for-tgcalls.patch')
-rw-r--r-- | fix-ffmpeg-build-for-tgcalls.patch | 129 |
1 files changed, 57 insertions, 72 deletions
diff --git a/fix-ffmpeg-build-for-tgcalls.patch b/fix-ffmpeg-build-for-tgcalls.patch index c8c9ee5e3a15..866a56b67a2b 100644 --- a/fix-ffmpeg-build-for-tgcalls.patch +++ b/fix-ffmpeg-build-for-tgcalls.patch @@ -1,72 +1,57 @@ -From da288b3cf4f91937da5bb8de0570dfa64871f4d9 Mon Sep 17 00:00:00 2001 -From: Nicholas Guriev <nicholas@guriev.su> -Date: Mon, 7 Mar 2022 11:52:01 +0300 -Subject: [PATCH] Fix build against FFmpeg v5.0 - -It has been released on January 17th. This patch keeps source compatibility -with older versions. ---- - tgcalls/group/AudioStreamingPartInternal.cpp | 5 ++++- - tgcalls/group/AudioStreamingPartPersistentDecoder.cpp | 2 +- - tgcalls/group/VideoStreamingPart.cpp | 5 ++++- - 3 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/tgcalls/group/AudioStreamingPartInternal.cpp b/tgcalls/group/AudioStreamingPartInternal.cpp -index 27a71cb..5639036 100644 ---- a/tgcalls/group/AudioStreamingPartInternal.cpp -+++ b/tgcalls/group/AudioStreamingPartInternal.cpp -@@ -104,6 +104,9 @@ _avIoContext(std::move(fileData)) { - - _frame = av_frame_alloc(); - -+#if LIBAVFORMAT_VERSION_MAJOR >= 59 -+ const -+#endif - AVInputFormat *inputFormat = av_find_input_format(container.c_str()); - if (!inputFormat) { - _didReadToEnd = true; -@@ -144,7 +147,7 @@ _avIoContext(std::move(fileData)) { - - _streamId = i; - -- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000); -+ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000); - - if (inStream->metadata) { - AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0); -diff --git a/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp b/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp -index e79d430..63ef475 100644 ---- a/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp -+++ b/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp -@@ -32,7 +32,7 @@ class AudioStreamingPartPersistentDecoderState { - AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) : - _codecParameters(codecParameters), - _timeBase(timeBase) { -- AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id); -+ const AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id); - if (codec) { - _codecContext = avcodec_alloc_context3(codec); - int ret = avcodec_parameters_to_context(_codecContext, codecParameters); -diff --git a/tgcalls/group/VideoStreamingPart.cpp b/tgcalls/group/VideoStreamingPart.cpp -index a67514a..10457eb 100644 ---- a/tgcalls/group/VideoStreamingPart.cpp -+++ b/tgcalls/group/VideoStreamingPart.cpp -@@ -280,6 +280,9 @@ class VideoStreamingPartInternal { - - int ret = 0; - -+#if LIBAVFORMAT_VERSION_MAJOR >= 59 -+ const -+#endif - AVInputFormat *inputFormat = av_find_input_format(container.c_str()); - if (!inputFormat) { - _didReadToEnd = true; -@@ -323,7 +326,7 @@ class VideoStreamingPartInternal { - } - - if (videoCodecParameters && videoStream) { -- AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id); -+ const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id); - if (codec) { - _codecContext = avcodec_alloc_context3(codec); - ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters); +diff --color --unified --recursive --text --color tgcalls-orig/tgcalls/group/AudioStreamingPartInternal.cpp tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp +--- tgcalls-orig/tgcalls/group/AudioStreamingPartInternal.cpp 2022-03-12 21:25:28.361577625 +0800 ++++ tgcalls/tgcalls/group/AudioStreamingPartInternal.cpp 2022-03-12 21:27:38.658250834 +0800 +@@ -103,7 +103,9 @@ + int ret = 0;
+
+ _frame = av_frame_alloc();
+-
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const
++#endif
+ AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -144,7 +146,7 @@ +
+ _streamId = i;
+
+- _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
++ _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
+
+ if (inStream->metadata) {
+ AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
+diff --color --unified --recursive --text --color tgcalls-orig/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp +--- tgcalls-orig/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp 2022-03-12 21:25:28.361577625 +0800 ++++ tgcalls/tgcalls/group/AudioStreamingPartPersistentDecoder.cpp 2022-03-12 21:26:59.081582180 +0800 +@@ -32,7 +32,7 @@ + AudioStreamingPartPersistentDecoderState(AVCodecParameters const *codecParameters, AVRational timeBase) :
+ _codecParameters(codecParameters),
+ _timeBase(timeBase) {
+- AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(codecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ int ret = avcodec_parameters_to_context(_codecContext, codecParameters);
+diff --color --unified --recursive --text --color tgcalls-orig/tgcalls/group/VideoStreamingPart.cpp tgcalls/tgcalls/group/VideoStreamingPart.cpp +--- tgcalls-orig/tgcalls/group/VideoStreamingPart.cpp 2022-03-12 21:25:28.361577625 +0800 ++++ tgcalls/tgcalls/group/VideoStreamingPart.cpp 2022-03-12 21:26:34.978247636 +0800 +@@ -280,6 +280,9 @@ +
+ int ret = 0;
+
++#if LIBAVFORMAT_VERSION_MAJOR >= 59
++ const
++#endif
+ AVInputFormat *inputFormat = av_find_input_format(container.c_str());
+ if (!inputFormat) {
+ _didReadToEnd = true;
+@@ -323,7 +326,7 @@ + }
+
+ if (videoCodecParameters && videoStream) {
+- AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
++ const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
+ if (codec) {
+ _codecContext = avcodec_alloc_context3(codec);
+ ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters);
|