From patchwork Fri Aug 25 18:42:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 4841 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp566244jao; Fri, 25 Aug 2017 11:50:51 -0700 (PDT) X-Received: by 10.28.213.203 with SMTP id m194mr180071wmg.41.1503687051248; Fri, 25 Aug 2017 11:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503687051; cv=none; d=google.com; s=arc-20160816; b=IqmNauZZ1hE4dJV8fXkw38wuEAxd9kec5a1jTPA7yb7t75VeUD793PcAb919g8MHAY DSeNK6NQnYz6uD/+AipPsih10v/Zsw7ox0/5LlenaXGZA8pjHil1M2/ryWAtV21HvkbC 3YYgXQWWgGK2L7hBrTftJhz833QkojX0E8n9X/LjtYnDzUE1t4PFc44kH5BTvaCHn4e2 82DsEgQPaZMjEkVzJdTxEwcyE9wgSwMrF2qgLbiYiw7BkOEJSEosVizJXfYs7zVtOdtj Tf3BxV61Mt4URUv9dJX5RCCZY+lDbY5Cg7JxN6Nk7/yBhF2AapHzw+yubuvBBrVdEKuq FSPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=FpySB9eW9GMcf0cMK37sSGjUI7FuIgUf9STPnvw2ECQ=; b=03Emp4mqg4DNgCkPp+OMcOjfTqhWc/G5GlEdFbdKoxm26b8QwVvrpqiOYFbMRwnD4V eNE3AoJQfZxVsf6+KF6kI5Qzfodtg9gtqXAZix+zZS/gFXYhBYt45eUk9GkFf38YGQJ4 NMSHOV3nfAZASg99KXJhL3i/jQkEuhAElQ+Ef/hnTMw8jnoFMMNAOEUkD/TP3FFTgP2H iFbbS6s4PiYRMKOpbcuEnhoIJoCAQE7pVtFDdjfc8wwfMXhDYjXvmr8hHXP+BvZGoxLW cUdiRFLIdhrW1Wv7TOAvi+aeMuzdQZpoff/Jfxr8STqhhZ5DK6wZnatpDrbivx9CI6qt OmCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=iHpnzHVk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i6si1716673wmf.226.2017.08.25.11.50.50; Fri, 25 Aug 2017 11:50:51 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=iHpnzHVk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F3F3D689AD7; Fri, 25 Aug 2017 21:50:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F04BB689A87 for ; Fri, 25 Aug 2017 21:50:32 +0300 (EEST) Received: by mail-wr0-f193.google.com with SMTP id p8so342198wrf.3 for ; Fri, 25 Aug 2017 11:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=lerwskujk8EVxiGI7iTNGdqnrME3iGTrHdqA4crsA/A=; b=iHpnzHVkwuxjcYT9s2UEB2lcjm9KL8dzgeEQzl6dLmZPB2js5PfYqojS/USKbCz1jU MbBvMC2j7s7tq904yzosot5kvUyhyYm9cayENI5Pnamv/YXN1qlv5/WYmjGKLlTS0vuF z26esG1YL1fFart/nwvpk5IxcLIKcCwbjRxC8emrirZyOOoUC3shWxFCxwAAD05Y9AoB 0hVmTHnPDCgkYePQQ5iUm2mIqTLAB+2n+nMbdXvkAAhryLyGueqYrcygUu24qMRtAUBn WkaFpAREOw3/sjglf2uAYY98Xrs/TggZAUaox811mThsrNbLeyd4lguPJmJh6w22rAG8 5xmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=lerwskujk8EVxiGI7iTNGdqnrME3iGTrHdqA4crsA/A=; b=ASMqOoqNvglltIXhAtUaA7go+m6pi89XIT4j+brdwJ4ZBs7LlJYR4UZe/YNGMJ1NV+ pRDhPKRHtSlUzD81w+1xJ3UVCIzkbRtu7DtMMkzIY6KIK8STfRd9cRNjx2Pjae7mt1+e EXLwNzzZUubOYqHnjTX2ECgppjDm3buQZPkmrkKo2hUqCllAEORFOMQZk39kqIbkooMf yeAXmUSrqOLvdpLFl9fQbxeG6nzHd5WumgsvtkEIJBD8S9qFd1S1SND8LRefu+aOy43x XLIHGF6pM3rEJQeIZVTTyS5D4RaE9kynQ3U+9jzuzf5vqMU8FSEn9T4ngj/WR+lK+p9O G9Rw== X-Gm-Message-State: AHYfb5gdk9mvtx55UMXAnxQHoraSA8gHgkYbYyhS/Z5kvn5NDJ8nwEZx bSa7vialjh7dHG9h X-Received: by 10.223.169.201 with SMTP id b67mr6170866wrd.314.1503686573027; Fri, 25 Aug 2017 11:42:53 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id 62sm6720668wrb.12.2017.08.25.11.42.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2017 11:42:52 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 Aug 2017 20:42:41 +0200 Message-Id: <20170825184241.457-1-onemda@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH] avfilter/af_join: detect EOF immediately 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Prevents hang. Signed-off-by: Paul B Mahol --- libavfilter/af_join.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c index f8af0a1..7fbab47 100644 --- a/libavfilter/af_join.c +++ b/libavfilter/af_join.c @@ -24,6 +24,9 @@ * a single output */ +#define FF_INTERNAL_FIELDS 1 +#include "framequeue.h" + #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" @@ -402,13 +405,16 @@ static int join_request_frame(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; JoinContext *s = ctx->priv; - int i; + int i, ret; /* get a frame on each input */ for (i = 0; i < ctx->nb_inputs; i++) { AVFilterLink *inlink = ctx->inputs[i]; - if (!s->input_frames[i]) - return ff_request_frame(inlink); + if (!s->input_frames[i] || + /* detect EOF immediately */ + (ctx->inputs[i]->status_in && !ctx->inputs[i]->status_out)) + if ((ret = ff_request_frame(inlink)) < 0) + return ret; } return 0; }