From patchwork Sun Mar 18 19:09:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 8030 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.70 with SMTP id c67csp1872343jad; Sun, 18 Mar 2018 12:09:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELverLsd7x22EhVil5kfl5fI75pP6oqphVrehgPA4BlkHwMDRyB4sWMUZ64Hc3O5plNm1dJb X-Received: by 10.223.142.13 with SMTP id n13mr6783079wrb.133.1521400170825; Sun, 18 Mar 2018 12:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521400170; cv=none; d=google.com; s=arc-20160816; b=U/ks1j1BeWDcsJdZTCs6qQN5IYYj7jD4WemTKL6hwQ6ZufWRBF1DJyxZJlOXzZlx33 h+EXJEWazsRANSzO4EdfOy0uWsOWzjYQPzCp/yYR4ayF2f+wzHLfNOZJhLpRySgmqZwc TgXIPoRgchqDA+lJ/41w8Wepm9+zpCKviAtm86cB6alGx2PLRqVXxAr7OuzAtHn4CUxY qJqXriY8QcXiIep/YCgAey3PMzt61X2U9+RkJ/9AoP2VuvMB78KH72P21b56Wj8wB7iz wUElJuUbgiVs36vmMPzCKjo4lUbi795NqO1lRl+Amg/kx1azezmBqRP1Z035+ORZwLeX iaeg== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=lmgKs9hTVzkm7EHz7SF4luvvbWspU5cZwwh7HpLcJ70=; b=afLom9FG+B4lX3jFwCjnzpORmvfyIAm6fQH6dAS8rJr7IxpM6GhhOEVRc8dmCcEY2q c950ozGgWsk//Q/kF2Fu3gNd9eg245YP1T1+xoOWi06T3KCUcPcmXSHij030YXorz8ZD rLlhw1v4aEkX1cbTD2RbB8gDGenIXStsXRyzDJ1SYViKNy5hAl+j0yYFR3jAjWx8IZsW X802yLZi4JaBmyMWE09lddbXMyM5N0/HhhSwfUWq49ZrW/Cpu6qBtBLXRu3fNUElm4u8 oVSqBWH5Vo+N3Qs0ilh1ipi+cidOa4J4+dOKJn1wkBovsuQI302kkobw+gvk5ckagbK0 eK0g== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b193si4827577wmd.13.2018.03.18.12.09.30; Sun, 18 Mar 2018 12:09:30 -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 11641689D89; Sun, 18 Mar 2018 21:09:09 +0200 (EET) 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 E5BB3689CC2 for ; Sun, 18 Mar 2018 21:09:02 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 847DDE11F3; Sun, 18 Mar 2018 20:09:16 +0100 (CET) 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 GXJPbfZgFNhN; Sun, 18 Mar 2018 20:09:15 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id CEF6DE119B; Sun, 18 Mar 2018 20:09:15 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Mar 2018 20:09:09 +0100 Message-Id: <20180318190909.31057-2-cus@passwd.hu> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180318190909.31057-1-cus@passwd.hu> References: <20180318190909.31057-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 2/2] ffmpeg: do not finish output streams manually on eof even if no input is provided 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" The generic code should be able to finish the streams just fine initializing and flushing the filters and codecs properly. Signed-off-by: Marton Balint --- fftools/ffmpeg.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 8876c99560..5399397c6e 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2186,7 +2186,7 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame) static int ifilter_send_eof(InputFilter *ifilter, int64_t pts) { - int i, j, ret; + int ret; ifilter->eof = 1; @@ -2213,16 +2213,6 @@ static int ifilter_send_eof(InputFilter *ifilter, int64_t pts) av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input %d, stream %d after EOF\n", ifilter->ist->file_index, ifilter->ist->st->index); return AVERROR_INVALIDDATA; } - for (i = 0; i < fg->nb_inputs; i++) - if (!fg->inputs[i]->eof) - break; - if (i == fg->nb_inputs) { - // All the input streams have finished without the filtergraph - // ever being configured. - // Mark the output streams as finished. - for (j = 0; j < fg->nb_outputs; j++) - finish_output_stream(fg->outputs[j]->ost); - } } return 0;