From patchwork Tue Apr 14 01:46:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 18936 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 83A2F44AFB2 for ; Tue, 14 Apr 2020 04:46:25 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F30D68B81A; Tue, 14 Apr 2020 04:46:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2B9A068B7EB for ; Tue, 14 Apr 2020 04:46:19 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id h2so11273782wmb.4 for ; Mon, 13 Apr 2020 18:46:19 -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=1J7l0E4Tj9W7ehXcF9e4/AveOOi2tE431GYLfzxjDRg=; b=psOfvsJR5EwvQLHV/uxmRsTJU/gdfRlW598BVAXBVCJfA0qTgdD3To3xBNZjbVunsi fT1CSeXlm8rrpuZboWaXamzwK/F31zj1wSX5/IKBFvGf7fCJGMt3MUGnlDxkOvc7vlCP cmYI8IrnGC+jH128zonPQRoiBgig6+fCiLX9SCKJM45YMukHnFM8ZvPa3JFqZbglNJcr L18IkR9g6DLO5H2/1yk1As5KLeDetvluEr66D3eqIYYmzrdSg8ejZOmPDNPfIhEB86tw qsZj4j+GxC8hq83OP8bU3uJtzxOQsqRd9Lyv2xcMG5XPZNrF6ND0znDGRaKa+iJ33gDO mEyQ== 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=1J7l0E4Tj9W7ehXcF9e4/AveOOi2tE431GYLfzxjDRg=; b=ehQa0xMuj7lJoczc8gL0KzAx70+UzluOwHzIjXHCnQZV+2GP6Zut2wc8LIaJt1A5at RWw56Bs6w/ZQJjMzNrVyGNkC4/kBC/qGMoCAS1jXPZrAWm/sgJ3f7EdpR/jKuyPxegyZ 15I9nKduposWhwj5PPePCBd2+ZFfk3dxIuZTX5a/l88Q/yIFpbYP8PIUwdIEhzNu1eZZ 0DGqtg1Nki+iAKPJEm7A4+ESdMX4M3m2xRbAT570IjYbjbt3XNp7GTboWyRpH2yK3eJR MsTSPN6PsQOhuD7cJCZbimjotFfwnrsYyu3Z42rVC5KptfKTfdOYeGaNmHPC33PmK56C KJHw== X-Gm-Message-State: AGi0PuafdG9GO8iggLxXlDhXmJ/joQv7e0c650NuzFCBxc8smC1w0qaH AXtXHhdNLmfaLPbQFCmHYO75sFgJ X-Google-Smtp-Source: APiQypINbsgU5k5NlPKHhk2odhYEki9zJYT8jdzKbpoZ/GdlQwE/BbOXe7tA7GSxVsvtNGQfqfG5pQ== X-Received: by 2002:a1c:a3c5:: with SMTP id m188mr20868500wme.176.1586828778129; Mon, 13 Apr 2020 18:46:18 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id c190sm16754140wme.10.2020.04.13.18.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 18:46:17 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Apr 2020 03:46:10 +0200 Message-Id: <20200414014610.30933-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200405155928.9323-1-andreas.rheinhardt@gmail.com> References: <20200405155928.9323-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/matroskaenc: Don't write elements with their default 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This has happened when writing chapters: Both editions as well as chapters are by default not hidden and given that we don't support writing hidden chapters at all, we don't need to write said elements at all. The same goes for ChapterFlagEnabled. Signed-off-by: Andreas Rheinhardt --- This is supposed to get applied before the cosmetics patch. libavformat/matroskaenc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index d0a02c0f5d..d3256d8f5d 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1400,7 +1400,6 @@ static int mkv_write_chapters(AVFormatContext *s) editionentry = start_ebml_master(dyn_cp, MATROSKA_ID_EDITIONENTRY, 0); if (mkv->mode != MODE_WEBM) { put_ebml_uint(dyn_cp, MATROSKA_ID_EDITIONFLAGDEFAULT, 1); - put_ebml_uint(dyn_cp, MATROSKA_ID_EDITIONFLAGHIDDEN , 0); } for (i = 0; i < s->nb_chapters; i++) { ebml_master chapteratom, chapterdisplay; @@ -1420,10 +1419,6 @@ static int mkv_write_chapters(AVFormatContext *s) (uint32_t)c->id + (uint64_t)mkv->chapter_id_offset); put_ebml_uint(dyn_cp, MATROSKA_ID_CHAPTERTIMESTART, chapterstart); put_ebml_uint(dyn_cp, MATROSKA_ID_CHAPTERTIMEEND, chapterend); - if (mkv->mode != MODE_WEBM) { - put_ebml_uint(dyn_cp, MATROSKA_ID_CHAPTERFLAGHIDDEN , 0); - put_ebml_uint(dyn_cp, MATROSKA_ID_CHAPTERFLAGENABLED, 1); - } if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { chapterdisplay = start_ebml_master(dyn_cp, MATROSKA_ID_CHAPTERDISPLAY, 0); put_ebml_string(dyn_cp, MATROSKA_ID_CHAPSTRING, t->value);