From patchwork Thu Sep 7 08:59:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5025 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1672910jao; Thu, 7 Sep 2017 02:00:01 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7+CwlTea+hYP1M6XvsdWlwXhHO7UdFoFL6/7b8TYIAI/NkawynIKbwEa8GLwuONAyhZB0m X-Received: by 10.28.143.205 with SMTP id r196mr1929265wmd.144.1504774801281; Thu, 07 Sep 2017 02:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504774801; cv=none; d=google.com; s=arc-20160816; b=De1UCTaSLj0gF4gHkzT3UVx03cZiEDysWyr+qzpqBN3JUPRog2PeNQGn2PgsHU7GBD sdTBTsJaUmF7d178oQkyPy4DvYfN5MBzBL2oi374+zLGZ4+94fQhmeKnp3oVbKG6+rAJ cad96nEPxPVUi3Y1Qui83qcMsosqFZxGEcQfXyxsLxpGP/Tlgh+VWeH/o85IaWfAAzGV A1DqzXODi8Q4CF+EiUiaNcvW5l6o3MT2xPPZuXZplAcyavWHSMdYKPUG22f3EFgQz18A KvWRVskiZpBzsbnpY7lduePEl6iAe5F3WE9S6UNA3Q9+sTSQ9jL2IBGok0Pq3rDn6mWp JF2w== 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=OaB6ZvIbvVOa0IjjKfd8OXSKBc3dMH1VQlIoLnGbwPc=; b=OMT1yJVicLpKxEUe31UG3fY9DRMLyXVeWV3EFTs5M/dYd3v7ES9OFVmoqVHMcDPTdj nnXnPQhedMvqlKoDsYDBQwFPFCAbuUwTt8uOoGv/iwxjXVCjQMVrCDkb7ZDEwSHzf8ON tkKqpA406HRHh3uV1WhoLiNm4RUohDkuUNSYR/3upbFqJrEM+cIfflEo+kKmH6ilIJZB xPu9d1zHp27PpzFepVo3+g8FD2xWDaws/Ps+b8jY+BluK93ibeUMo1vPGq/5028EAciM I7sq1a92iMXIL5nNG2vHeksZ4m7eHSTYssWqcwa1sJCgVngyFexpzA//ygMbhM38o5jT 1sWg== 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 v19si1467307wra.442.2017.09.07.02.00.00; Thu, 07 Sep 2017 02:00:01 -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 D1C9D689E1B; Thu, 7 Sep 2017 11:59:44 +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 28395689DF6 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 v878xfpe089835 for ; Thu, 7 Sep 2017 10:59:41 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 5BE3EE00AC; Thu, 7 Sep 2017 10:59:41 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2017 10:59:36 +0200 Message-Id: <20170907085939.21770-2-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:41 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 2/5] ffmpeg: rename a variable. 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" Makes the reason of the "FIXME" comment more obvious. Avoid name conflicts for the next commit. Signed-off-by: Nicolas George --- ffmpeg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) This patch and the following have already been discussed. The changes are tested and work, but they were on hold pending possible checks by Michael. Since nothing comes, I will push soon unless somebody objects with new arguments. With this patch series, when a filter uses ff_request_frame() and it returns EOF, inlink->current_pts is correctly set to the end timestamp of the stream. It applies in particular to Thierry's patch for vf_fps. diff --git a/ffmpeg.c b/ffmpeg.c index ccb6638e0a..c8ee64621c 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2628,7 +2628,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo // while we have more to decode or while the decoder did output something on EOF while (ist->decoding_needed) { - int64_t duration = 0; + int64_t duration_dts = 0; int got_output = 0; int decode_failed = 0; @@ -2645,22 +2645,22 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo &decode_failed); if (!repeating || !pkt || got_output) { if (pkt && pkt->duration) { - duration = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); + duration_dts = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) { int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->dec_ctx->ticks_per_frame; - duration = ((int64_t)AV_TIME_BASE * + duration_dts = ((int64_t)AV_TIME_BASE * ist->dec_ctx->framerate.den * ticks) / ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame; } - if(ist->dts != AV_NOPTS_VALUE && duration) { - ist->next_dts += duration; + if(ist->dts != AV_NOPTS_VALUE && duration_dts) { + ist->next_dts += duration_dts; }else ist->next_dts = AV_NOPTS_VALUE; } if (got_output) - ist->next_pts += duration; //FIXME the duration is not correct in some cases + ist->next_pts += duration_dts; //FIXME the duration is not correct in some cases break; case AVMEDIA_TYPE_SUBTITLE: if (repeating)