From patchwork Tue Apr 2 13:33:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhupengfei via ffmpeg-devel X-Patchwork-Id: 12583 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 36E98447FF3 for ; Tue, 2 Apr 2019 16:35:30 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 20E0968AD1C; Tue, 2 Apr 2019 16:35:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8324C68AD11 for ; Tue, 2 Apr 2019 16:35:28 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id w1so16736646wrp.2 for ; Tue, 02 Apr 2019 06:35:28 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=tA7/NR75AVDTdrOxFH2jcGTBRvNqKlC2Dkxtj1DLbaY=; b=AJgB1wg3OF7VpoIToY5jm71m6OBmih58+WgLY+Gt+wmhtfIPzza9juenxIjIyDujGX BEnPUsW8MojZ+6Ct0Nr2tUHxcpNOnZjL7rZDife+p8Vqd7YXxSsctIbmXh/Q7GKC/ucU D4FlIJkNoEdHPhC93UOQZAXy6DDtQ50sTGv9vR/kQpo3OOm4iGORI/cFIKrEx4k6iKqW xqVXyx/eGcYEWwnySXt0aymBxFPAQXEIPWQmkNmseffR5OxjbV1+kHsWNiGcKq8TAoJZ 86cMy+kd/UJDkMtxw4qOxQiXUadCIIXVb28ilpsarec0/ept2Q/LaB2Gd1JGNdHIqybB bcng== X-Gm-Message-State: APjAAAU4Ri1yn0h+brbgdWfDumb8/mTiXtGesjMI8lDrtxByhFuqgDqc 2Zi8fIcZhxZawak+Qrb6g8j4O6Z0qJc= X-Google-Smtp-Source: APXvYqwalk96gvSZBNazxsNk/DWFULsfBj0qIar7KOxdSRoD4OGrXo4QK82UtWCXW6lAPUiQVd+Q5g== X-Received: by 2002:adf:ef0c:: with SMTP id e12mr44586270wro.170.1554212127902; Tue, 02 Apr 2019 06:35:27 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.googlemail.com with ESMTPSA id t24sm15566886wmi.10.2019.04.02.06.35.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 06:35:27 -0700 (PDT) To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 Apr 2019 15:33:04 +0200 Message-Id: <20190402133305.3328-15-andreas.rheinhardt@googlemail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190402133305.3328-1-andreas.rheinhardt@googlemail.com> References: <20190402133305.3328-1-andreas.rheinhardt@googlemail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/15] avformat/matroskaenc: Improve log messages for blocks 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: , X-Patchwork-Original-From: Andreas Rheinhardt via ffmpeg-devel From: zhupengfei via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Up until now, a block's relative offset has been reported as the offset in the log messages output when writing blocks; given that it is impossible to know the real offset from the beginning of the file at this point due to the fact that it is not yet known how many bytes will be used for the containing cluster's length field both the relative offset in the cluster as well as the offset of the containing cluster will be reported from now on. Also, the log message for writing vtt blocks have been brought in line with the message for normal blocks. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 0a82271f54..2df2cfd2ad 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2122,10 +2122,10 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, ts += mkv->tracks[pkt->stream_index].ts_offset; - av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, " - "pts %" PRId64 ", dts %" PRId64 ", duration %" PRId64 ", keyframe %d\n", - avio_tell(pb), pkt->size, pkt->pts, pkt->dts, pkt->duration, - keyframe != 0); + av_log(s, AV_LOG_DEBUG, "Writing block at relative offset %" PRId64 " in " + " cluster at offset %" PRId64 "; size %d, pts %" PRId64 ", dts %" PRId64 + ", duration %" PRId64 ", keyframe %d\n", avio_tell(pb), avio_tell(s->pb), + pkt->size, pkt->pts, pkt->dts, pkt->duration, keyframe != 0); if (par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 0 && (AV_RB24(par->extradata) == 1 || AV_RB32(par->extradata) == 1)) ff_avc_parse_nal_units_buf(pkt->data, &data, &size); @@ -2229,9 +2229,10 @@ static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *p size = id_size + 1 + settings_size + 1 + pkt->size; - av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, " - "pts %" PRId64 ", dts %" PRId64 ", duration %" PRId64 ", flags %d\n", - avio_tell(pb), size, pkt->pts, pkt->dts, pkt->duration, flags); + av_log(s, AV_LOG_DEBUG, "Writing block at relative offset %" PRId64 " in " + " cluster at offset %" PRId64 "; size %d, pts %" PRId64 ", dts %" PRId64 + ", duration %" PRId64 ", keyframe %d\n", avio_tell(pb), avio_tell(s->pb), + size, pkt->pts, pkt->dts, pkt->duration, 1); blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(size));