From patchwork Tue Apr 23 19:45:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 12875 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 7B9D844752A for ; Tue, 23 Apr 2019 23:31:37 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EB7E4680328; Tue, 23 Apr 2019 22:53:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C9044680190 for ; Tue, 23 Apr 2019 22:53:06 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id c12so15609423wrt.8 for ; Tue, 23 Apr 2019 12:53:06 -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 :mime-version:content-transfer-encoding; bh=CDDn5m83V1B9u70YVv19LCD0SWz/AJkdy8I4fPPYeJY=; b=u4HV5URP/iCP7tfTajvtoUf3sbEL1PKtYSgyP6O1qIpT/eV8LEwyuf3mU9z/UZxBuI 3eIcCoJPSg2/kgFZ44SHaBDNxvCTV+K0gJqlaKjZ29dqPNOmxHC7JyS3oXPGBzSKIfbm 5WckkuUoXgdhfjA0mSr5mZzCOmyKm87nYFBNCjijOVSwPgRRXt3eCVsAm6jw7v5s9RlW QPwltdpfOPeeXg4n+PHtad9iKDfv+VX7RGs8djxq8kgip8SwiuNZXTT9KAmuJMDZRjho 6XvwceoOu/YJlPxO6azuP1uAxykqD2auUrHAcZqgmH0VrvyWN7qDzoCUWjy/14HF/fAV t5pQ== 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=CDDn5m83V1B9u70YVv19LCD0SWz/AJkdy8I4fPPYeJY=; b=R2dNPIzSYhgzmLIppjaFfx0Ov/JMObZNBgQZvLRxXV+QuXZWFS0xZJHEr6H4eqlilx 4kt3ETRj8ndgqZuRjpMKGTh9fF1kwMnPvRhcFVpk+eV55ZEdgPYqwgDqYpZDg8ilgBCL Ji1iMBRYm904B7b+OmdaoBkM0r2eezlOv/1ryJ2uKf2dsfKAX27NBz7wOgVV1S6hZB2r 3+8O9RJCLdctoWMCF09CG4z7KqE4vPCBCLYlJ5sIQGCdVVd1tdWNwRZifD+6cckKjts2 KWcCE/QLIHaPqGmcHFFj3+lP2FSiy3gEinFy7LQarZt5p0pOsVhc9s7/h0aYcNeikrz0 Kf4w== X-Gm-Message-State: APjAAAVC0Q3iO93gRfvBq4BmYslN8LQe0ygsdAApsvP3U5L19xMXM5k5 F5YEzI+rQXA4GQzi7BBnCBCOQVjO X-Google-Smtp-Source: APXvYqwXJkTRz+802EHiB9yYsP+ePS6HlQwkS0Ns0/tkeo8Xtfiw8Z6kbPgJO/ZoDf1nW2mPrH3Jow== X-Received: by 2002:adf:f90c:: with SMTP id b12mr17916602wrr.63.1556048815024; Tue, 23 Apr 2019 12:46:55 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.gmail.com with ESMTPSA id p6sm14551042wrs.6.2019.04.23.12.46.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 12:46:54 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Apr 2019 21:45:52 +0200 Message-Id: <20190423194552.4524-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190419234110.32980-14-andreas.rheinhardt@gmail.com> References: <20190419234110.32980-14-andreas.rheinhardt@gmail.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: , 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. Furthermore, the TrackNumber of the written block has been added to the log output. 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 | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 441315e2d5..01ccc9524c 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2124,10 +2124,14 @@ 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); + /* The following string is identical to the one in mkv_write_vtt_blocks + * so that only one copy needs to exist in binaries. */ + av_log(s, AV_LOG_DEBUG, + "Writing block of size %d with pts %" PRId64 ", dts %" PRId64 ", " + "duration %" PRId64 " at relative offset %" PRId64 " in cluster " + "at offset %" PRId64 ". TrackNumber %d, keyframe %d\n", + pkt->size, pkt->pts, pkt->dts, pkt->duration, avio_tell(pb), + mkv->cluster_pos, track_number, 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); @@ -2231,9 +2235,14 @@ 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); + /* The following string is identical to the one in mkv_write_block so that + * only one copy needs to exist in binaries. */ + av_log(s, AV_LOG_DEBUG, + "Writing block of size %d with pts %" PRId64 ", dts %" PRId64 ", " + "duration %" PRId64 " at relative offset %" PRId64 " in cluster " + "at offset %" PRId64 ". TrackNumber %d, keyframe %d\n", + size, pkt->pts, pkt->dts, pkt->duration, avio_tell(pb), + mkv->cluster_pos, pkt->stream_index + 1, 1); blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(size));