From patchwork Thu Sep 10 23:49:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22274 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 889BC44A710 for ; Fri, 11 Sep 2020 02:49:41 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 707DD68B9D3; Fri, 11 Sep 2020 02:49:41 +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 0F25E68B9CB for ; Fri, 11 Sep 2020 02:49:35 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id e17so2616708wme.0 for ; Thu, 10 Sep 2020 16:49:35 -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=80uIFdNDieBqzKmLzy6xClbLWgvk524THnTq8Hsp4fc=; b=SyOGGHBShnaEgTs2JqMK4veKh59dDHixwWabeAW6993b9nwaoPJpzCQWzhLTN1KraB N3edIqPyYeGLb0YPfCJWRp5uBvGA+cMnNRTnlOWZbfJQU2TqNI9vBenDxSdRmim5jNJO Nb2/IJyqg3rhOH8sQUOSlNzIVanTpfbEc0z+lGk95qji0OLGZY3JURursR83T9Sk/FaM 3FqZnnmkE5lDlp1in4E99iyBELsq81TVw5OUyiSVlZ9KEICo76UoA+vlRtjO0R6UVgJc +xtp8AlSq35efILkHnQ1lsVyg8gdKiFe/FwMPQe7PqNdu7MnNVASGckZry8285LOOjmL 5d3A== 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=80uIFdNDieBqzKmLzy6xClbLWgvk524THnTq8Hsp4fc=; b=HIIbJIvJ1pv5WQyRrZpXL/Qik2+yGV9fwR0Q2mj/rzXwGUOByUhrU7rdd6FGAyOF7f 3XA0HcG/jYcPVTk9gcBqZZRb0e9npGtFxeHcZvMOY4xytrLq2oSYxp5KIuhAuoka1vXI L0Zl2XfvykYJZ/3MJUn71sfHNwFJS7oZdSG9sT2YVGYAJcb4fatrUGO6UoxVIUJYKu0q al145RWyuBnt98zRgIfZYq5I1cKDmvQaqnOo0RTbZykOMvkN9L7w2rOGyXcPb+7lxtSA phKvWDD9rripvV9bl4raBPtdUHZUpdzq6aklpYdUbwzDXB5tYKmcD3LxK/NpVtj/42yn W+6A== X-Gm-Message-State: AOAM533MF6vwOWRdMx2AVIkuR8fyyvyzUZfIHmeDPCvfEinnAZQ4+t+t 1/TCOuFQ2TZ7+6Ihyxes1mRNeHmYAdk= X-Google-Smtp-Source: ABdhPJy1HbUsC7pH/7vxbupcb3OQT4yHZpjYORKwwUBDhtEOizA8gKjWyY48ac4K+iBrz/zBu6gGqQ== X-Received: by 2002:a1c:cc0d:: with SMTP id h13mr2322123wmb.44.1599781774329; Thu, 10 Sep 2020 16:49:34 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id j135sm586592wmj.20.2020.09.10.16.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 16:49:33 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Sep 2020 01:49:11 +0200 Message-Id: <20200910234911.12891-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200910234911.12891-1-andreas.rheinhardt@gmail.com> References: <20200910234911.12891-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/formats: Remove pointless checks 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" ff_formats_ref() takes a pointer to an AVFilterFormats and a pointer to a pointer to an AVFilterFormats as arguments and adds the latter as an owner to the list pointed to by the former; the latter is hereby always the address of a list contained in an AVFilterFormatsConfig and can therefore not be NULL. So remove the check for whether it is NULL; also do the same for ff_channel_layouts_ref(). Also do the same for the unref functions where argument is never NULL because it is always the address of an existing lvalue. Signed-off-by: Andreas Rheinhardt --- libavfilter/formats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 98ff82a887..43c90b9a27 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -269,7 +269,7 @@ do { \ do { \ int idx = -1; \ \ - if (!ref || !*ref) \ + if (!*ref) \ return; \ \ FIND_REF_INDEX(ref, idx); \ @@ -495,7 +495,7 @@ AVFilterChannelLayouts *ff_all_channel_counts(void) #define FORMATS_REF(f, ref, unref_fn) \ void *tmp; \ \ - if (!f || !ref) \ + if (!f) \ return AVERROR(ENOMEM); \ \ tmp = av_realloc_array(f->refs, sizeof(*f->refs), f->refcount + 1); \