From patchwork Thu Apr 6 08:44:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 3313 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp555409vss; Thu, 6 Apr 2017 01:45:06 -0700 (PDT) X-Received: by 10.28.52.84 with SMTP id b81mr23144390wma.30.1491468306226; Thu, 06 Apr 2017 01:45:06 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q63si12570541wmd.78.2017.04.06.01.45.05; Thu, 06 Apr 2017 01:45:06 -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 6E9FA68834F; Thu, 6 Apr 2017 11:44:59 +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 EA194680CCC for ; Thu, 6 Apr 2017 11:44:52 +0300 (EEST) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v368itjR047361 for ; Thu, 6 Apr 2017 10:44:55 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 42265E8C4D; Thu, 6 Apr 2017 10:44:55 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Apr 2017 10:44:48 +0200 Message-Id: <20170406084451.27892-1-george@nsup.org> X-Mailer: git-send-email 2.11.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Thu, 06 Apr 2017 10:44:55 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 1/4] 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(-) Unchanged. diff --git a/ffmpeg.c b/ffmpeg.c index ea03179c21..4db8ea82ac 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2617,7 +2617,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) { - int duration = 0; + int duration_dts = 0; int got_output = 0; int decode_failed = 0; @@ -2634,22 +2634,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)