From patchwork Thu Apr 13 14:12:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41150 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1287485pzb; Thu, 13 Apr 2023 07:16:59 -0700 (PDT) X-Google-Smtp-Source: AKy350Z/ZADG5CpAr9u7s8OQeQdymCaL6mC+hFBcZr01mOxexDBW5oxrWD4gSXwKD4SEb3562wZQ X-Received: by 2002:a17:906:1857:b0:94a:4e86:31bc with SMTP id w23-20020a170906185700b0094a4e8631bcmr6743620eje.13.1681395419575; Thu, 13 Apr 2023 07:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681395419; cv=none; d=google.com; s=arc-20160816; b=tZYNblO5fES+4hhSv1avALJ6gOkZqrLVXN+N7pL+YhJ3+0DEWXyDbGNayY95+d5M2B ZjH01xB16neSNhaparVJYx74mKHQXxLVMDicw5XnWNjxi30/rg+nTAAI+papGA+bNS5u pxD8ntEr2GkfuuyhdcomqVS9heNTfmIf0RciOEmP026cmW4UDJuV18M1JsBiOTnifQ4r yqDijDpX6fzxrFyTVTZf55NASQf/hYkj02wUS2GwCya7Grce3gskadSaFEJ7PWvo4AiI 1ZFty9xh+10/6+VK9YdqJKKtOUo9EgO5XB9oRKiPxJYWh0428t9FrOFqdPgqMWeybarV 04Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=bLFpyrzbNZncJwkty04IFUNvagFTsjApH5ElwZHy5iE=; b=ZCoUh5jifZ/EljmcJ1gcIJOO5wQa2Yg+cJLIi38GiOMZmLW5hzhhGMKkNU3Zi4nude eX1JQ0g5czAYo8Xu46MXgJ5cB2I/xTo51eut6LisxlLySgLQ249d2AQz0DbuvwdrKK1t +EOQPlYqElEgQi5g1gPeVr5cXMj2bXNMicLozf2e0AfjkGloaGPN66HTK3SFsBBAlhJa 5RPPche5FXBX0L8DZZe3nax66RlRPp0qF8XlYRjsDMtFybIwDO1wVhxDg+XRlc80pNTh r4l7WJgUquQaJOtsz3Gn9GyOXAzF67qZCufvQDO0eW2fNI9ciSVupF6bUgF3X/BBqfz3 rpAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ff18-20020a1709069c1200b009492273178esi1790293ejc.220.2023.04.13.07.16.59; Thu, 13 Apr 2023 07:16:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 67CE068BE68; Thu, 13 Apr 2023 17:16:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 33D8B68BDA5 for ; Thu, 13 Apr 2023 17:15:56 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id E4FDB240591 for ; Thu, 13 Apr 2023 16:15:55 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 7VIPpzlljQmA for ; Thu, 13 Apr 2023 16:15:55 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 3BD1D2405B5 for ; Thu, 13 Apr 2023 16:15:53 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id EAAB93A0404 for ; Thu, 13 Apr 2023 16:15:52 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Apr 2023 16:12:02 +0200 Message-Id: <20230413141223.17245-4-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230413141223.17245-1-anton@khirnov.net> References: <20230413141223.17245-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/25] fftools/ffmpeg_mux_init: remove a redundant check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: agxi3crDOa7W --- fftools/ffmpeg_mux_init.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 06a6b3fd2d..e3d66b9897 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -917,18 +917,16 @@ static int streamcopy_init(const Muxer *mux, const OptionsContext *o, } } - if (ist->st->nb_side_data) { - for (int i = 0; i < ist->st->nb_side_data; i++) { - const AVPacketSideData *sd_src = &ist->st->side_data[i]; - uint8_t *dst_data; - - dst_data = av_stream_new_side_data(ost->st, sd_src->type, sd_src->size); - if (!dst_data) { - ret = AVERROR(ENOMEM); - goto fail; - } - memcpy(dst_data, sd_src->data, sd_src->size); + for (int i = 0; i < ist->st->nb_side_data; i++) { + const AVPacketSideData *sd_src = &ist->st->side_data[i]; + uint8_t *dst_data; + + dst_data = av_stream_new_side_data(ost->st, sd_src->type, sd_src->size); + if (!dst_data) { + ret = AVERROR(ENOMEM); + goto fail; } + memcpy(dst_data, sd_src->data, sd_src->size); } #if FFMPEG_ROTATION_METADATA