From patchwork Fri Oct 19 12:27:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jay@wizardofthenet.com X-Patchwork-Id: 10717 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 01BD044779C for ; Fri, 19 Oct 2018 15:28:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4AC9168A73B; Fri, 19 Oct 2018 15:27:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp105.ord1d.emailsrvr.com (smtp105.ord1d.emailsrvr.com [184.106.54.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE9F568A72A for ; Fri, 19 Oct 2018 15:27:39 +0300 (EEST) Received: from smtp6.relay.ord1d.emailsrvr.com (localhost [127.0.0.1]) by smtp6.relay.ord1d.emailsrvr.com (SMTP Server) with ESMTP id 909FFE024D; Fri, 19 Oct 2018 08:28:04 -0400 (EDT) X-Auth-ID: jay@wizardofthenet.com Received: by smtp6.relay.ord1d.emailsrvr.com (Authenticated sender: jay-AT-wizardofthenet.com) with ESMTPSA id 4BCC7E010E; Fri, 19 Oct 2018 08:28:04 -0400 (EDT) X-Sender-Id: jay@wizardofthenet.com Received: from python-centos7.fdn.ad (usa-67-224-107-242.sohonet.co.uk [67.224.107.242]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256) by 0.0.0.0:465 (trex/5.7.12); Fri, 19 Oct 2018 08:28:04 -0400 From: Jason Stevens To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Oct 2018 05:27:36 -0700 Message-Id: <20181019122736.26032-1-jay@wizardofthenet.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] ffmpeg: flush_encoders should not treat avcodec_send_frame return AVERROR_EOF as fatal X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Jason Stevens Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" this fixes AV_CODEC_CAP_DELAY encoders going into FATAL error and exiting on quit or finish encoding once they go into draining mode and send_frame() returns AVERROR_EOF Signed-off-by: Jason Stevens --- fftools/ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index da4259a9a8..f30ed946c0 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1939,7 +1939,7 @@ static void flush_encoders(void) while ((ret = avcodec_receive_packet(enc, &pkt)) == AVERROR(EAGAIN)) { ret = avcodec_send_frame(enc, NULL); - if (ret < 0) { + if (ret < 0 && ret != AVERROR_EOF) { av_log(NULL, AV_LOG_FATAL, "%s encoding failed: %s\n", desc, av_err2str(ret));