From patchwork Thu May 16 22:29:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 13174 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 7A914449B3C for ; Fri, 17 May 2019 01:51:33 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 620D368A791; Fri, 17 May 2019 01:51:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1E5A968A71F for ; Fri, 17 May 2019 01:51:32 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id x64so5116367wmb.5 for ; Thu, 16 May 2019 15:51:32 -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=Gs5ae4oeTBTCNqn7hI2VSFmQFPVFh90AvlFIza66Pvw=; b=N3m7Mt3EjwCNwcLe2MuXLifLy9gaXd3tgAjov/KTGHjRk0IWjym+Ax6rhQE6EBX5Y1 IA46lJ9GDKooV5o72cbh3zY5dZG/Ppdp3DfhGnytl0tYLI1hIB4nhn8y23/vI4v75dRR LEjx6wQFyxWly2qxfZSOe1rIy1llULzeiSuTPXAkEN9f9X29Tj2CJBG8AcUP8YOIUGsa nQ5IT2u/ts3/ws54revwS4QFQJmCjpZzA7P2hUD31cZGUBAIdFcZbVirjSMj5jmtHsEy udumTn/9H1u0sCKvGjiVJYnI+b83FVQHiPqJ+eh8SAgOXbac9spQLLC9dj61WnRjEgk0 hg7g== 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=Gs5ae4oeTBTCNqn7hI2VSFmQFPVFh90AvlFIza66Pvw=; b=aDt2u3twHmiDcYSnwr9tqrX5vcNUcTsnNxEyeJWw9GVT28LbN8Ueg7b1EDQ5HB64b1 TVlaBUkcdRmeOliO3jAgVd6sPT+ssdjpMDTOtHxQ4fwjPyi2BrMPSwVyST2MGsZYeywf DlLquEAe/pYh9NqC/hr4xMMzCBd+YM/Tv6KvobJW5qvqwleQ+hYGWr4mFFiPI+e+hiHy WrWG63vxeH4vZ0xDz1emAM83hlt4tA75LidL57y7jxRCvkWC3sqQD/NqOJEAbeGT3YgR GjIMZbyuXyl1GUlYAtsu2MH7Z1TfhtSDXzCvTdjiEzwj3nQw3pZ6GAgcHDjYJpWzp1KP 3P8g== X-Gm-Message-State: APjAAAUQilh5kAVHVyy/9al/CWg7TxWmjoUNlI4XSd9JzL7gigGudWp5 2bWhvUaGN+17WN0di/xkl77e/oM6 X-Google-Smtp-Source: APXvYqzRMaS0oVDLJ4wW2LXdDm4xrST57Nt6TbEid43gYi8Nc1knRsV6PxIGOfPCYQv0bbeo4wxeFQ== X-Received: by 2002:a1c:6783:: with SMTP id b125mr30245721wmc.41.1558046589184; Thu, 16 May 2019 15:43:09 -0700 (PDT) Received: from localhost.localdomain (ipbcc18715.dynamic.kabel-deutschland.de. [188.193.135.21]) by smtp.gmail.com with ESMTPSA id i185sm11168725wmg.32.2019.05.16.15.43.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 15:43:08 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 May 2019 00:29:53 +0200 Message-Id: <20190516223018.30827-10-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190516223018.30827-1-andreas.rheinhardt@gmail.com> References: <20190516223018.30827-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/37] avformat/matroskadec: Remove redundant initialization 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" Every new element of an EbmlList is zeroed initially in ebml_parse_elem, so that in particular a SimpleBlock's duration is initialized to zero. Therefore it is unnecessary to initialize this field again (for SimpleBlocks) in matroska_parse_cluster_incremental. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskadec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 0f9d55566f..34bc86f25f 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3516,8 +3516,7 @@ static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska) int is_keyframe = blocks[i].non_simple ? blocks[i].reference == INT64_MIN : -1; uint8_t* additional = blocks[i].additional.size > 0 ? blocks[i].additional.data : NULL; - if (!blocks[i].non_simple) - blocks[i].duration = 0; + res = matroska_parse_block(matroska, blocks[i].bin.buf, blocks[i].bin.data, blocks[i].bin.size, blocks[i].bin.pos, matroska->current_cluster.timecode,