From patchwork Thu Sep 7 08:59:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5027 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1673244jao; Thu, 7 Sep 2017 02:00:19 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6WCVRiQgvQpaWYu4lZOzi1eG5AnW6cxeO/oGviI09UdgCvKFbqIMYYq03ytiJRJvACvu0u X-Received: by 10.28.30.13 with SMTP id e13mr1646402wme.72.1504774819039; Thu, 07 Sep 2017 02:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504774819; cv=none; d=google.com; s=arc-20160816; b=i17Xj2YHlxhAyTtixh/pTNTqon+SzgTei5G5GzIkHJj4anfB45O0v//PzJQ9AEiN5u nz6sj7/n8c0d4q9YBx1Me7g1e2NReF1LjMw17m6ANvsi3srWNNkuQcHIk6kygxGIlYXO Ep3eXn2AJIh9qA7eyj/fiaQ5X5kvjEICmPdRhQS+mtHpBYcAo0PgfCnG3V3moLWMPh6P 1CJWjTek0AgQxmuxf/xTx+FJ7mErDBuP60SJMNvcp9YgmrkLID0HbL8z/LfBUSyUrMam OdNQicsSGpsfyE9gYNMYwoEsjvcqqXi/P/VrMrOI2lsKGAKwk5MJ2SwD2SbTr6K+tMi7 thaA== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=gWE7IXrBsR8HLDG70JNSutZ7im2fuPYkSRToDhZGaoc=; b=0Aswch+U4TV28eWNKMdvfsAJiga+NteHN7jvySQYHSNZoThoLTPbTpuA0dft/fJHq8 CuNb3Hf2yVuut28/xVTku19WyqZCHyPyvk6xloXWMJ74DhPHyQUmeY+LuAYqW8qNP+9O IPNwGSQfpvx2TIXmZEMcqhI/7lfVLwN9504fS68mB9KydxRnjQwZAqwS7+3jM1JrtWrY 0BjyiPFpplMwTHv4oGIprzEdiMd+ustjd2aZ6ykl7dRPF41bmSlb0SGBpaY+f0EIEqBv AQJOVi3O41w4uCT2M6gq/i/tNLP9NDvL25ulyq5ymP+I6KVcDw05pcMWFH8YcX71YZ/j 7nPQ== 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 h15si59022wma.227.2017.09.07.02.00.18; Thu, 07 Sep 2017 02:00:18 -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 833E2689E1C; Thu, 7 Sep 2017 11:59:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2B756883D8 for ; Thu, 7 Sep 2017 11:59:38 +0300 (EEST) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v878xgrG089847 for ; Thu, 7 Sep 2017 10:59:42 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id EFE2AE00AC; Thu, 7 Sep 2017 10:59:41 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2017 10:59:39 +0200 Message-Id: <20170907085939.21770-5-george@nsup.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170907085939.21770-1-george@nsup.org> References: <20170907085939.21770-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Thu, 07 Sep 2017 10:59:42 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 5/5] ffmpeg: send EOF pts to 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Nicolas George --- ffmpeg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index b95addd277..1d248bc269 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2223,14 +2223,14 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame) return 0; } -static int ifilter_send_eof(InputFilter *ifilter) +static int ifilter_send_eof(InputFilter *ifilter, int64_t pts) { int i, j, ret; ifilter->eof = 1; if (ifilter->filter) { - ret = av_buffersrc_add_frame_flags(ifilter->filter, NULL, AV_BUFFERSRC_FLAG_PUSH); + ret = av_buffersrc_close(ifilter->filter, pts, AV_BUFFERSRC_FLAG_PUSH); if (ret < 0) return ret; } else { @@ -2581,8 +2581,12 @@ out: static int send_filter_eof(InputStream *ist) { int i, ret; + /* TODO keep pts also in stream time base to avoid converting back */ + int64_t pts = av_rescale_q_rnd(ist->pts, AV_TIME_BASE_Q, ist->st->time_base, + AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); + for (i = 0; i < ist->nb_filters; i++) { - ret = ifilter_send_eof(ist->filters[i]); + ret = ifilter_send_eof(ist->filters[i], pts); if (ret < 0) return ret; }