From patchwork Fri Feb 10 12:35:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wm4 X-Patchwork-Id: 2478 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp474038vsb; Fri, 10 Feb 2017 04:36:54 -0800 (PST) X-Received: by 10.28.54.90 with SMTP id d87mr27853878wma.89.1486730213974; Fri, 10 Feb 2017 04:36:53 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g56si1980758wra.248.2017.02.10.04.36.52; Fri, 10 Feb 2017 04:36:53 -0800 (PST) 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=@googlemail.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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F23CC689DF2; Fri, 10 Feb 2017 14:35:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C9266689DD8 for ; Fri, 10 Feb 2017 14:35:53 +0200 (EET) Received: by mail-wm0-f65.google.com with SMTP id u63so7183852wmu.2 for ; Fri, 10 Feb 2017 04:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T4AEGoUnpOcycrPo8c6tnLSvl7HiyabjpUvqyPnYYWs=; b=gyYJf37WD0pjFQsSLqPo6Fleh7sUdo9PqSmWasKDJB4IsYS/4fKYmnGPIWhkzCerrN YmEPIK53kpzqtIS7a6QrNdNMkUMnos7mBMq+YErhs76Cbb2TTWej3EO4tNuMALD+9BoK LZbHTZ/990el6mbQCsWVPtSjGMiAh6/AQV2dInZGRNK3z4HOkVwzb43Pj/aZ7DaJmIG1 GiqCTHIpIm0dpTaae0y7xyfAQgEmYsUWPN5uNOq0v6dbXzw8dcBUys+agiFV855XZl3j GKwQ9Zyz56uznpff0VvvsnO0o6rghKCF92HEdh15xds/in0FLCqT+BvvDlrUJzmKrvta Wd/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T4AEGoUnpOcycrPo8c6tnLSvl7HiyabjpUvqyPnYYWs=; b=mjWY5o+JmOPZ7IoEmQESuuntIJXmHs8mAS0XJzIoJ8i+eJZYGqOABmACehR3JolPWG hUtoKK3Eu0Ye93dgZ6XN8/y+8NQ8ZAupAoT5FChUdW/e2EVM9Kcf18U02m4Kl3DyPPmu ESuuawjr8mubMBmsverst1qeyz45Ew9dwD98/BeUQET256Y2IIx8x0WPRxCdVtWlpnZO Sb/3KC9RcKVIexdKQbpU8LyOJodtIYZn7C+GckcChtJ+fnIw1tFj/tRXwewnCH3JU1sE QM5TN5CykaHW1nPliSdL6/MbWPdMx6+z725crtvXQCG5CacYT+CQITKCT2pLTJe8orBA /lqA== X-Gm-Message-State: AMke39m/1g46rroGrrSMWPrsJpRqPD7C65JvlQQ2EijgQaUHslpmNYforNRknJ9iQJciQg== X-Received: by 10.28.67.134 with SMTP id q128mr25660737wma.34.1486730157297; Fri, 10 Feb 2017 04:35:57 -0800 (PST) Received: from localhost.localdomain (p4FF029FA.dip0.t-ipconnect.de. [79.240.41.250]) by smtp.googlemail.com with ESMTPSA id s18sm1413656wmb.18.2017.02.10.04.35.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Feb 2017 04:35:56 -0800 (PST) From: wm4 To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Feb 2017 13:35:37 +0100 Message-Id: <20170210123541.32375-6-nfxjfg@googlemail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210123541.32375-1-nfxjfg@googlemail.com> References: <20170210123541.32375-1-nfxjfg@googlemail.com> Subject: [FFmpeg-devel] [PATCH 5/9] ffmpeg: move flushing the queued frames to configure_filtergraph() 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: wm4 , Anton Khirnov MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Anton Khirnov This is a more appropriate place for it, and will also be useful in the following commit. This merges Libav commit d2e56cf. It was previously skipped. Signed-off-by: wm4 --- ffmpeg.c | 11 ----------- ffmpeg_filter.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index a3d36a76a7..f816808489 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2137,17 +2137,6 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame) av_log(NULL, AV_LOG_ERROR, "Error reinitializing filters!\n"); return ret; } - - for (i = 0; i < fg->nb_inputs; i++) { - while (av_fifo_size(fg->inputs[i]->frame_queue)) { - AVFrame *tmp; - av_fifo_generic_read(fg->inputs[i]->frame_queue, &tmp, sizeof(tmp), NULL); - ret = av_buffersrc_add_frame(fg->inputs[i]->filter, tmp); - av_frame_free(&tmp); - if (ret < 0) - return ret; - } - } } ret = av_buffersrc_add_frame(ifilter->filter, frame); diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index f21a8c85f8..4d9a4e2eb8 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -1117,6 +1117,17 @@ int configure_filtergraph(FilterGraph *fg) ost->enc_ctx->frame_size); } + for (i = 0; i < fg->nb_inputs; i++) { + while (av_fifo_size(fg->inputs[i]->frame_queue)) { + AVFrame *tmp; + av_fifo_generic_read(fg->inputs[i]->frame_queue, &tmp, sizeof(tmp), NULL); + ret = av_buffersrc_add_frame(fg->inputs[i]->filter, tmp); + av_frame_free(&tmp); + if (ret < 0) + return ret; + } + } + return 0; }