From patchwork Tue Oct 3 22:48:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 5403 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.76 with SMTP id m12csp177726jah; Tue, 3 Oct 2017 15:49:47 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCEg65GqZc5FG9J91OpkWrAde0fbDFhmgBhXi5rVbTMuMYzDLIl/NQf2cR9MD1lPXjwybNa X-Received: by 10.28.139.72 with SMTP id n69mr5520396wmd.29.1507070987812; Tue, 03 Oct 2017 15:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507070987; cv=none; d=google.com; s=arc-20160816; b=OL3+3Ilr7B5cnFnpB3h6Eq141E3GC4wQWq+8zJgBTVsdPi2iAMUIwfFsITcB25PuCS aA33oAtW5tWjmV17cFb3oTAuRzICHgjK+d9vdCr2pS7YtAnyUv58JnAJZYDRunOD3+o0 p4q8A7xwbxJKGhG3irDAdRz3Nf5SOV15nlvYeHUyLqVgSncRwFeqPlIhvFPe/uOj+Z2m /wYCY0n0roOBiIXOiiQiDbRd/VhGcBrP8cOdvbYZ8sz8r9I/jeGYC+S/j51Pw5mH0rre /T++3Inx18arF8tjCqG/jz3Tga/HgmVVaqD42eQi5ZHy2ib4Wj6ealYDAwhqhj7ZVeYY w9hg== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=vgJr5XvoNVTVP3xQ6jScn8XZGuJ2SkfP7I4V69rKMsA=; b=ubKp6wwl2aq85yD1Rq5ApnE46b+qMetbc2moKIeVIpalKVDNH2Pi8/ih5X/LPn6mmI Ozg8wneTjkfl8RfQOcsbVM4O71k2H+k40JPWrAMkH/UKHxZiK2/9SPMR/ETtdQJWHVOG 0s30QjHcB2/aaqrVdwXLFLCqmLmUMsmES7KGk+PexzBDfEOkS+vjYX3RUt1Mx/hqtRmP J6Xx/qgTo8PrESi3ZoFkuWxZQHH+Tw4WLN9JVU6N04FVwEHfycfHEt+yBqV/WR3HGID2 AT1f/A8EvypNzxY15voc2SkjvOMOeYHsWuKNXN/EE1gllNWbNy5bGlFPvSIP9eOf19Ja KU9w== 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 b68si4742894wmf.60.2017.10.03.15.49.46; Tue, 03 Oct 2017 15:49:47 -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 E51BA68A124; Wed, 4 Oct 2017 01:49:30 +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 916F668A106 for ; Wed, 4 Oct 2017 01:49:24 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A077DE1062; Wed, 4 Oct 2017 00:49:39 +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 Yb5X6f3fU5im; Wed, 4 Oct 2017 00:49:38 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A9FE3E100F; Wed, 4 Oct 2017 00:49:38 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Wed, 4 Oct 2017 00:48:23 +0200 Message-Id: <20171003224823.4888-1-cus@passwd.hu> X-Mailer: git-send-email 2.13.5 Subject: [FFmpeg-devel] [PATCH] ffmpeg: always init output stream before reaping filters 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" Otherwise the frame size of the codec is not set in the buffersink. Fixes ticket #6603 and the following simpler case: ffmpeg -c aac -filter_complex "sine=d=0.1,asetnsamples=1025" out.aac Signed-off-by: Marton Balint --- fftools/ffmpeg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 1d248bc269..5be8788ea8 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -4528,6 +4528,15 @@ static int transcode_step(void) } if (ost->filter && ost->filter->graph->graph) { + if (!ost->initialized) { + char error[1024] = {0}; + ret = init_output_stream(ost, error, sizeof(error)); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d -- %s\n", + ost->file_index, ost->index, error); + exit_program(1); + } + } if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0) return ret; if (!ist)