From patchwork Wed Mar 27 11:18:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Felix de Souza via ffmpeg-devel X-Patchwork-Id: 12481 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 66C8A448DC9 for ; Wed, 27 Mar 2019 13:21:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 50F3768A8F3; Wed, 27 Mar 2019 13:21:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 12E7368A8FD for ; Wed, 27 Mar 2019 13:21:09 +0200 (EET) Received: by mail-wm1-f67.google.com with SMTP id h18so16347357wml.1 for ; Wed, 27 Mar 2019 04:21:08 -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=nzux10d3/33xBLIQSRCqDplwDsvi8pXq04HLhrEFWXA=; b=nr4R+xKBX4TzxuNc5dIt5Z6A25oEM455b5MId7OpA9iwEbkP8qqwEylINkW1YywjMS NBIHS0wI1Shnkn38M+QCIerlKWYUXwK+xF0NzOXUOsJQ3469TUt+Ymlw4M67u6SqYIZd 4nXFcxrUXEp+qmw/vS6BYvO4cgYOnRjJNMx2HTkYvbGfPa1Cy0mlH246QkYfjURPurwX VgrwzRste4+yN8T5ugYcu7y8AFr9K7AxaxuxTFECMoPlvNqOdZixQc4059uLpvcN5tg7 t82WG/M/4ZHVuaXZGdyQV+eyNeM1eyqgQQAc4RagrsncgbmzpAr7Oc9iv0w9hY9fRw82 vmoA== X-Gm-Message-State: APjAAAXAmXb2W3pXYlueRKqzin6I4B1vtSpjx/eeLjP0zO+9937BWnS5 pDJeYvh9yQRaXbYxgppo4hKBupPegck= X-Google-Smtp-Source: APXvYqxEG1txKxUMSgI7fRkIK49QnFzV38eG4xEbuTSiWJJ1CuVMFpybKHrleLv5rT4j/2spuU45Mw== X-Received: by 2002:a1c:1a4d:: with SMTP id a74mr17958900wma.50.1553685668273; Wed, 27 Mar 2019 04:21:08 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.googlemail.com with ESMTPSA id h10sm31745448wrs.27.2019.03.27.04.21.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 04:21:07 -0700 (PDT) To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Mar 2019 12:18:38 +0100 Message-Id: <20190327111852.3784-8-andreas.rheinhardt@googlemail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190327111852.3784-1-andreas.rheinhardt@googlemail.com> References: <20190308092604.3752-1-andreas.rheinhardt@googlemail.com> <20190327111852.3784-1-andreas.rheinhardt@googlemail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/21] 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: , X-Patchwork-Original-From: Andreas Rheinhardt via ffmpeg-devel From: Diego Felix de Souza via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt , robux4@ycbcr.xyz 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 f1cfc09a5f..a6617a607b 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3498,8 +3498,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,