From patchwork Sun Sep 8 20:21:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 51407 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9c4f:0:b0:48e:c0f8:d0de with SMTP id w15csp1360796vqu; Sun, 8 Sep 2024 18:09:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVUeBFhAF+P/OnSPTPD6Vxn2LA45bN6zgFD+30nfNEEE5MnN5eb268ljyDQ0fInY1jXvFFkSYwgt7tp/c9QU+PP@gmail.com X-Google-Smtp-Source: AGHT+IGt3O4PqA9BYvBe+VIx+tYZRqHATyOdTEraoPYETWKr49prZaXZXx3/bmbzwmE10ILlu1xv X-Received: by 2002:a05:6512:1388:b0:535:4144:bf90 with SMTP id 2adb3069b0e04-536588198eemr3295940e87.11.1725844150987; Sun, 08 Sep 2024 18:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725844150; cv=none; d=google.com; s=arc-20240605; b=Mkc0l92SXW4hfee+o3rz2wsTAo8X27mNU/Bh7ZCvXTzY1dIewo7DVHsLPWGgqN/1dS CEfN+/S6Et+p5wpdUUo9TUq7evoovWgwsjC6tVJv59MDMGqGXM8Yq2RCloDnpKHdVT5M C8BEmdTOffYMuderSSyzaGlt7bK22034wdFpCPZ6lMYu7kUWGHiH6Pmh/J6QYELg1r+J jAmIoEAQLjuLPHLLH0gF2C0ViHC+cAaMhyMUGuzazrRtnXTRm1GdI66keg+IVi23ksTK u1Em6cO10bInOAg8BSE1EgKM63vxbXYSqP3d0neOvOi+CkbBtjTxwAdAdhiQzo2ydM9O imFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:date:from:to:message-id:in-reply-to :dkim-signature:delivered-to; bh=/2Evg/Y0CcvyTKWJmU+8kRsJs0wXkMqSvmeW96ba8PU=; fh=5IeVwzS1vbVKjIV8MP3mnmnRtZGb8uteQ9r4QD2keV0=; b=KXUh+FCwdu8KrPddQ/rpuF0mio1ojkxDz9dkhRPsALhL69wzlk1yAMw54UgmOv97PU YDHRHB+trvjC/7lw2b3AdiMJSpvOAlGsSoSZBncXZUZtlOixu+GeUxhxT+Yl+RHYpzvd hB+xHYYsTKC6fBhqPUKXBXZ7KKAfI8dQgXIjuEIvkxY7WnQ015V3dhzsESPIOrTMt032 EYUqy0ymV2xU/p3r6lHYFpTgQ/lvsO3GAxnOYaIbly+RuZokgTcOijY+4oJ1tHB+VApE 2dYN35KpiaWkrsoWzNozBrYZY5y2V40oGL6pkA49/ucbwTaXogZUs5ebD/ScEx8oA2TR ztkw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ewsDorT5; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-5365f8c1568si1358974e87.267.2024.09.08.18.09.10; Sun, 08 Sep 2024 18:09:10 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ewsDorT5; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2413F68DC7B; Mon, 9 Sep 2024 03:55:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 981D068DBB8 for ; Mon, 9 Sep 2024 03:55:21 +0300 (EEST) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-374c6187b6eso2252117f8f.0 for ; Sun, 08 Sep 2024 17:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843321; x=1726448121; darn=ffmpeg.org; h=subject:date:from:to:message-id:in-reply-to:from:to:cc:subject:date :message-id:reply-to; bh=wCLIGWCD+LiJqdxNwHFO0qsNxW6ojn2uFnUA9G7c7SI=; b=ewsDorT5LBVrEjUK2nbnNRXy4RuuWEpNQUWx6e4QoLuFSbxHVAoCjZUjCMmcrETOPy MK4nLScxniZEDwlKO8RM51/df/gnIyZ+FYddB0jjowgYqKvXpNpPJUj8xEUdmfkfAKDG 6PHJWQrDVBOZi/prhf1pareSyqgNs/3djlBpaCdjpc49yMMxnzi624glkEjjzS/MB6JC 4ypfHsDlzJeGXtBPf1EF/z9s0XxH4dh8cjMqokFP+EhlnDK09pqvaG6VSVWfJer3/Fez o5IemYO4LJxVjAqZ3QfrDS1uihrvYWc73n1tgz0Hbm2Er09gI3toV3A9Cmqi50b3hw2L LJ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843321; x=1726448121; h=subject:date:from:to:message-id:in-reply-to:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wCLIGWCD+LiJqdxNwHFO0qsNxW6ojn2uFnUA9G7c7SI=; b=WIVYb34nYAlzzlaEC49tryiGqZc4p0g5SUylzI3KZSsmD1w5DivtyEE8OfARiiX0T+ qYU89mBDvVNyR6Gwgz4FQgP0d0PyhQ5tXMhYktVyZ+pQ4ZiAioDKggVr7YTdHnny1eh8 cGJ6Sz0DgCCy1H5E1QUoqE2NUAewM6JRB11847jlt1WCk1IQNQ7rRBNDE9sOmbTgVtVn j2wDmnQfF0yXkWE9sBeu+Jf1iqL6DqnY6Tk01PDJDQclMzovQD5Ny36GhjRXBZozlRAA ygL392W1OayB4WuSq2AYtqfYmjmVKNrZZ4KDLVD6RKtdLNcPWndcpzhBkMKTlMd3iHZI cyrA== X-Gm-Message-State: AOJu0YwDMl1HBz3HZxicqsmdfuPawEfn3gLXp0wou/k9k4qdiP+fr70F +FTQRv33VRZ1hmZndp9jKodVQLM/QY8unBBrjXkMSDM4ruXE67XnfbI0HQ== X-Received: by 2002:adf:ef87:0:b0:374:ca54:4065 with SMTP id ffacd0b85a97d-3788969f9f9mr5297437f8f.48.1725843320923; Sun, 08 Sep 2024 17:55:20 -0700 (PDT) Received: from localhost (p200300cccf1178009d94fda8472792f7.dip0.t-ipconnect.de. [2003:cc:cf11:7800:9d94:fda8:4727:92f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895649728sm4583399f8f.16.2024.09.08.17.55.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:55:20 -0700 (PDT) In-Reply-To: Message-Id: To: From: "Marvin Scholz" Date: Sun, 8 Sep 2024 22:21:03 +0200 Subject: [FFmpeg-devel] [PATCH 21/60] fftools/ffmpeg_mux_init: fix variable shadowing 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: vYnQIpEUWHaI --- fftools/ffmpeg_mux_init.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 8d475f5b45..c2867192ee 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -661,11 +661,9 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, } opt_match_per_stream_str(ost, &o->chroma_intra_matrices, oc, st, &chroma_intra_matrix); if (chroma_intra_matrix) { - uint16_t *p = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64); - if (!p) + if (!(video_enc->chroma_intra_matrix = av_mallocz(sizeof(*video_enc->chroma_intra_matrix) * 64))) return AVERROR(ENOMEM); - video_enc->chroma_intra_matrix = p; - ret = parse_matrix_coeffs(ost, p, chroma_intra_matrix); + ret = parse_matrix_coeffs(ost, video_enc->chroma_intra_matrix, chroma_intra_matrix); if (ret < 0) return ret; } @@ -728,8 +726,8 @@ static int new_stream_video(Muxer *mux, const OptionsContext *o, FILE *f; /* compute this stream's global index */ - for (int i = 0; i <= ost->file->index; i++) - ost_idx += output_files[i]->nb_streams; + for (int idx = 0; idx <= ost->file->index; idx++) + ost_idx += output_files[idx]->nb_streams; snprintf(logfilename, sizeof(logfilename), "%s-%d.log", ost->logfile_prefix ? ost->logfile_prefix : @@ -1145,21 +1143,20 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, return AVERROR(ENOMEM); if (ost->enc_ctx) { - AVCodecContext *enc = ost->enc_ctx; AVIOContext *s = NULL; char *buf = NULL, *arg = NULL; const char *enc_stats_pre = NULL, *enc_stats_post = NULL, *mux_stats = NULL; const char *enc_time_base = NULL, *preset = NULL; - ret = filter_codec_opts(o->g->codec_opts, enc->codec_id, - oc, st, enc->codec, &encoder_opts, + ret = filter_codec_opts(o->g->codec_opts, ost->enc_ctx->codec_id, + oc, st, ost->enc_ctx->codec, &encoder_opts, &mux->enc_opts_used); if (ret < 0) goto fail; opt_match_per_stream_str(ost, &o->presets, oc, st, &preset); opt_match_per_stream_int(ost, &o->autoscale, oc, st, &autoscale); - if (preset && (!(ret = get_preset_file_2(preset, enc->codec->name, &s)))) { + if (preset && (!(ret = get_preset_file_2(preset, ost->enc_ctx->codec->name, &s)))) { AVBPrint bprint; av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); do {