From patchwork Tue May 26 16:57:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 19878 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A584B44942B for ; Tue, 26 May 2020 19:57:52 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 86B316882F5; Tue, 26 May 2020 19:57:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D6906891E2 for ; Tue, 26 May 2020 19:57:45 +0300 (EEST) Received: by mail-pj1-f66.google.com with SMTP id nu7so45092pjb.0 for ; Tue, 26 May 2020 09:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=id554d/zQhO21WXREaeZy7dcdAU/mC8SVZLkKZ7WLjw=; b=Uq42fuoU66MA97Rs0gxn+H9IChF9JDB0sARcfiaCGdDAWu9KbUnUwfCnCGpb9/1wo5 y51jItnFdjZWY0bb9W4+Ro4rQhCCTJTPsTJ4+5TcQESTqeP22ikBBoxbovCcH5qmAj8t 9sNI4ckS/X0wixTGFRm2sUhL+b807Bfw96z2bFzzNMx714qYaNnp1V4cRF2N1CprWwW5 SbOPIvzBBd/zO4Fg6QSLaHe7j1ZtxVia+4MIQSL7PD19tI/0u08pws4QZfQQxBRHnffD qT0GxCBcTnGjlomNdq0RJXkHMl7zEduuTBbwNY/hfHxeQEh5G8T+f/upWDDOF8fq31b6 ibfA== 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=id554d/zQhO21WXREaeZy7dcdAU/mC8SVZLkKZ7WLjw=; b=QHuhMSIHAu7IswsRv6iNvvUFsFOt1YXprQzv/2yRigPz78lh6wVcoy+ZZkI1vXe95k 4PpDfomeuaZ51PEB04xndfGEe2nuywYE6Vt+noRtrBuCP2Qjh2cDVBC+q+Uw8OpYi1zi VIKqToctznrI8lHP8wQHGmTjcKJEu1TTOKSK0THmHIjN4oTrRXtBUUFo6AWHnCXhwKcn LcCStAMKNqz5ghXgRVL0MDjpEQ8DL0SkiuiURHGBZbxfuV1uS/O0lNKUHpdiO7pr1jQE AKKpWXSq2MDRiQ4eRGZ7FJMjOzUfeb8Wfr6EgRTrgNYuKrN92OEMDURvwQ9Xo+ymwLYy RSSw== X-Gm-Message-State: AOAM530alyiqYJZ3xGo3HnrYAzfttzqoR/IghAmTE97YuIO7IBNWImMM HIW/RgD/wnL/VOUfuHvg2N4VUpCh X-Google-Smtp-Source: ABdhPJyY33Fl3R2NqM5QZrUr8/ceGljcukIMViQtP80nsyVHPh5LxCe52HlQ3FbszVdU/bQEfiqSGA== X-Received: by 2002:a17:902:ee12:: with SMTP id z18mr2057052plb.62.1590512263123; Tue, 26 May 2020 09:57:43 -0700 (PDT) Received: from localhost.localdomain ([49.51.162.193]) by smtp.gmail.com with ESMTPSA id h21sm57159pjz.6.2020.05.26.09.57.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2020 09:57:42 -0700 (PDT) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 May 2020 00:57:08 +0800 Message-Id: <1590512230-26007-2-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590512230-26007-1-git-send-email-mypopydev@gmail.com> References: <1590512230-26007-1-git-send-email-mypopydev@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 2/4] lavf/utils: fix start_time/duration dump if it is AV_NOPTS_VALUE 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: Jun Zhao MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jun Zhao e,g: the command: ffprobe -show_format -i fate-suite/aac/foo.aac -loglevel 99 will dump the trace message as follow when start_time is AV_NOPTS_VALUE [aac @ 0x55bf8e1f3dc0] stream 0: start_time: -326791809695.818 duration: 2.174 [aac @ 0x55bf8e1f3dc0] format: start_time: -9223372036854.775 duration: 2.174 bitrate=120 kb/s after this fix, will dump the start_time with "NOPTS". Signed-off-by: Jun Zhao --- libavformat/utils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 2fe58eb..3f38218 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2984,16 +2984,16 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset) for (i = 0; i < ic->nb_streams; i++) { st = ic->streams[i]; if (st->time_base.den) - av_log(ic, AV_LOG_TRACE, "stream %d: start_time: %0.3f duration: %0.3f\n", i, - (double) st->start_time * av_q2d(st->time_base), - (double) st->duration * av_q2d(st->time_base)); + av_log(ic, AV_LOG_TRACE, "stream %d: start_time: %s duration: %s\n", i, + av_ts2timestr(st->start_time, &st->time_base), + av_ts2timestr(st->duration, &st->time_base)); } av_log(ic, AV_LOG_TRACE, - "format: start_time: %0.3f duration: %0.3f (estimate from %s) bitrate=%"PRId64" kb/s\n", - (double) ic->start_time / AV_TIME_BASE, - (double) ic->duration / AV_TIME_BASE, - duration_estimate_name(ic->duration_estimation_method), - (int64_t)ic->bit_rate / 1000); + "format: start_time: %s duration: %s (estimate from %s) bitrate=%"PRId64" kb/s\n", + av_ts2timestr(ic->start_time, &AV_TIME_BASE_Q), + av_ts2timestr(ic->duration, &AV_TIME_BASE_Q), + duration_estimate_name(ic->duration_estimation_method), + (int64_t)ic->bit_rate / 1000); } }