From patchwork Fri May 5 23:34:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 3584 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp459645vsd; Fri, 5 May 2017 16:34:17 -0700 (PDT) X-Received: by 10.223.142.213 with SMTP id q79mr31345859wrb.25.1494027257875; Fri, 05 May 2017 16:34:17 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t129si3974108wmt.4.2017.05.05.16.34.16; Fri, 05 May 2017 16:34:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B968B680A8F; Sat, 6 May 2017 02:34:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2FFBB680A8F for ; Sat, 6 May 2017 02:34:02 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 32DCE10301D; Sat, 6 May 2017 01:34:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I5kwvlmPskS8; Sat, 6 May 2017 01:34:05 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2E2AD102FEB; Sat, 6 May 2017 01:34:05 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 6 May 2017 01:34:04 +0200 Message-Id: <20170505233404.16279-1-cus@passwd.hu> X-Mailer: git-send-email 2.12.0 Subject: [FFmpeg-devel] [PATCH] lavfi/avfiltergraph: only return EOF in avfilter_graph_request_oldest if all sinks EOFed 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes a regression introduced in 32c59a115d3cc757676b5384a5ea44b5a7a7b872, becoming effective in 912969a33e313c57c906e87a7e2367b78a2160f4. Fixes trimmed output of ffmpeg -f lavfi -i "sine=d=0.01" -f lavfi -i "sine=d=1" -filter_complex "[0:a]anull[a1];[1:a]anull[a2]" -map "[a1]" -f null none -map "[a2]" -f framecrc - --- libavfilter/avfiltergraph.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index f7fbf119eb..598e50a077 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -1399,10 +1399,13 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) oldest = graph->sink_links[0]; if (oldest->dst->filter->activate) { /* For now, buffersink is the only filter implementing activate. */ - return av_buffersink_get_frame_flags(oldest->dst, NULL, - AV_BUFFERSINK_FLAG_PEEK); + r = av_buffersink_get_frame_flags(oldest->dst, NULL, + AV_BUFFERSINK_FLAG_PEEK); + if (r != AVERROR_EOF) + return r; + } else { + r = ff_request_frame(oldest); } - r = ff_request_frame(oldest); if (r != AVERROR_EOF) break; av_log(oldest->dst, AV_LOG_DEBUG, "EOF on sink link %s:%s.\n",