From patchwork Tue Apr 2 16:17:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thilo Borgmann via ffmpeg-devel X-Patchwork-Id: 12592 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 B5A0A448AB1 for ; Tue, 2 Apr 2019 19:18:06 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B84A68ACFA; Tue, 2 Apr 2019 19:18:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C8A7368ABDF for ; Tue, 2 Apr 2019 19:17:59 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id p10so17456118wrq.1 for ; Tue, 02 Apr 2019 09:17:59 -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=0QKQdY33zsyimQW1yDVGY3CvQN40/SpQlHMCE7Z1Rx8=; b=g5J395CJKODLZt9tMhyoGo5cnU0qrIvPTThDe6oKLs9bME1F/8dYLntFTF7h8l6ctP gT+ezIIsd4Va8gdpss+p3n5m72YdfQfqMKqlVqlyWBiZ3wmwWKgZ/GxUmqT7GikVWqrf Tgh0JNyvND0YD+oFK2hMvjpW03apCHAVxmlcWFIjFjRtU10m/JYUk/XSwlu7ZAeGGgnw gmA22d4iscDDc3kChw3obOI6WTwLOUJ4ybwAaBORm2tPVg+VoOa7Xp+9TbB5SDi7655+ XTT2ah8nhL+RWUxUsnyL19Dd8g8htLA0A988LmmKFKwSxGiddT384uDOmvDDOya+1NiK 9K4Q== X-Gm-Message-State: APjAAAXUtMzlUu8t9LFfxzFHPYuyC6tK9EltmvcWojB9adQrKtd8xAvN F53gbvTTDwaY905QUajVqe026jQwn4Y= X-Google-Smtp-Source: APXvYqx3bXlExPrhh8/hOYRAolgribYvez3PEIxlrulZH2vmVlq9Cq/5mgevafUYtuO4HZgfNNdbLQ== X-Received: by 2002:a5d:69c1:: with SMTP id s1mr49935836wrw.245.1554221879133; Tue, 02 Apr 2019 09:17:59 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.googlemail.com with ESMTPSA id t81sm25604466wmb.5.2019.04.02.09.17.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 09:17:57 -0700 (PDT) To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 Apr 2019 18:17:26 +0200 Message-Id: <20190402161726.2872-1-andreas.rheinhardt@googlemail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190402133305.3328-15-andreas.rheinhardt@googlemail.com> References: <20190402133305.3328-15-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: Thilo Borgmann 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 has 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..fd395a8b8d 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), mkv->cluster_pos, + 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), mkv->cluster_pos, + size, pkt->pts, pkt->dts, pkt->duration, 1); blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(size));