From patchwork Mon Aug 19 21:56:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 14596 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 8E056446A0F for ; Tue, 20 Aug 2019 01:10:29 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 671E068AA99; Tue, 20 Aug 2019 01:10:29 +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 AFB24689D73 for ; Tue, 20 Aug 2019 01:10:23 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id q12so10252064wrj.12 for ; Mon, 19 Aug 2019 15:10:23 -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=CjXKuLOHpHUzZr7xKNRzSmMhVc/k5U37nKh35da5Z0Y=; b=l2zhpQhLNHzlh92Kuo4wkJ5fbUH9xZYwfXwE9JLCdafq1UAeiNmJagm6OZHT4Uvh9J /ej1AQNyOjmHNuiyfcden68jDe+mlfnVpsJ+V0dSgRCBCO2LbRnBbfALX6OvLk9n0Uqa svrvP9wUeUFsixLrpP9N38paCDhgnEOfxJ+LPeJyclnAxlKJwB32UlUkY12c1/jFkyAb oWox5wrVGgjOjAU0/B5K5NTWa2UnNGi3tpO2lr/A+45Cd3SqFB4EQo7O/Rzy+XhS6cDy tm8VGMXvNxQS3DwUidqcX5WcaruBHeeC52VJtFwgEoUJGzQEr+DjUXMJ3QmO2QHzKdYb DamQ== 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=CjXKuLOHpHUzZr7xKNRzSmMhVc/k5U37nKh35da5Z0Y=; b=YQ3GST2mHDrzTMN+MTXVn4bs1GqG8o9dC+4+cbcbEoz6zqP1H1uj93ZDJv/+e9uGmE FkGviIOj0RZZFdDJ8oTqoFXPKf+f1QIemPJYeZzpiQNIC40ge9Bu2EZY3dO/w65LB+vw 0Ao59tM3siRno2Fm8L2d83odfuk6mOM8q6GbFpHWtvQ/INCqwfMRHKLzCIdb5Qydxe8z FsuNE+HWeLbKivM4q9NN7/TdYKaODQQ1j5aHKJkL57fc+hlA3eGW2Md65ehkuo9nZRbi MkDhNVn7/pzm0N8UsJ2Fi32ttD6x74tGdjf9xvA2cAq1WISP/RpL3Ssl7/ZcCfqJDmvJ Xxjw== X-Gm-Message-State: APjAAAUY7zfET0OnCQJirkf/98IepoO+WeC3TyhEN0nlkyZ0eAnfY8GR l7G0bWlqIZ1WBc3qVF9Z1/R2pL7Y X-Google-Smtp-Source: APXvYqx9oiwaxFEug9grpk2TerjhM2MYXXuOJadArvgLkMhUZfSSgwwmRlYFd8mUTBgiLAGiG84CiQ== X-Received: by 2002:adf:e8c3:: with SMTP id k3mr17911294wrn.8.1566252238910; Mon, 19 Aug 2019 15:03:58 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c5c.dynamic.kabel-deutschland.de. [188.192.140.92]) by smtp.gmail.com with ESMTPSA id s64sm32952293wmf.16.2019.08.19.15.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 15:03:58 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Aug 2019 23:56:24 +0200 Message-Id: <20190819215624.49795-8-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190819215624.49795-1-andreas.rheinhardt@gmail.com> References: <20190819215624.49795-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 8/8] avformat/utils: Remove unnecessary initializations 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, read_frame_internal always initialized the packet it received. But since the recent changes to ff_read_packet, this is no longer needed: If the parsing queue is initially empty upon entering read_frame_internal, the packet will now either contain content upon success or be blank upon failure of ff_read_packet. If the parsing queue is initially not empty, the packet will be overwritten with the oldest one from the parsing queue. Similarly, it is unnecessary to initialize ret. Signed-off-by: Andreas Rheinhardt --- libavformat/utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index d6d615b690..a81d1e6ca2 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1576,11 +1576,9 @@ static int64_t ts_to_samples(AVStream *st, int64_t ts) static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) { - int ret = 0, i, got_packet = 0; + int ret, i, got_packet = 0; AVDictionary *metadata = NULL; - av_init_packet(pkt); - while (!got_packet && !s->internal->parse_queue) { AVStream *st;