From e39f9bef1f1645edd7ac9489ff5f46764dd4c953 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 26 May 2021 09:59:19 +0400 Subject: [PATCH] Fix voice message recording with FFmpeg 4.2. --- Telegram/SourceFiles/media/audio/media_audio_capture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp index d129168783..43dd26da15 100644 --- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp +++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp @@ -709,8 +709,9 @@ bool Instance::Inner::writeFrame(AVFrame *frame) { if (frame && packetsWritten == AVERROR_EOF) { LOG(("Audio Error: EOF in packets received when EAGAIN was got in avcodec_send_frame()")); fail(); + return false; } - return false; + return true; } else if (!packetsWritten) { LOG(("Audio Error: No packets received when EAGAIN was got in avcodec_send_frame()")); fail();