From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8DD5043BCA for ; Wed, 21 Sep 2022 07:14:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 94E5A68BB64; Wed, 21 Sep 2022 10:14:26 +0300 (EEST) Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 17F9568B97C for ; Wed, 21 Sep 2022 10:14:20 +0300 (EEST) Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-3450a7358baso53551237b3.13 for ; Wed, 21 Sep 2022 00:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date; bh=Of3tmi5MkewHaK/TQyr458p9p9+iLNYKdhLvPULJfus=; b=hWk/NmaHmK3NhfX5tnrBd6ZXmNPOEpwYSuHoUTrUtgMyvbqlv2GsXYBhFCFWLKTrK3 EjuBvj4PC/y3buaW7ysBA4FRQTjJjYeozx2eNt8UHRIKtWJOjpIKeL+2CEhCAz9qaSOF XJ5E7Iq4oqlezCJaaJH1FbFSBJkSvVP/mqNXRZmuzma3wPDBlgKxEp4q6t6XZZPlK2LP CrpUYHHgMqvPVO2NSxxe0A4Q4WZX2ebyUm2Umc4eWtt2L9UOD6T43V6t5rPK27tRVEq2 5Yh4fFxVbHNIQqA+psv6IW7gGzqZ0/2yQk4zsjFdEGjcZeXIPcz68muyPK5C4WMUpMjS G+SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Of3tmi5MkewHaK/TQyr458p9p9+iLNYKdhLvPULJfus=; b=IqYt6g5cuUnnSSAt8B0eg10U3w0bv8jAB61udQ5zFw7NPsJfTMatpdhvgkLJhIEEFb fzZEouodyV9xlL1xwsu49PGmiiCEndLjzMY1vX60Xy8GBu526fq5R1PcjhbYKH6W/wyy PoktuJxilJt4J5KnWqVH844XfzaAY3OhIA/0VR3QCdNnWS+x1SMOrEZHDiyiG+95hTq6 Y4fMIrpIdryk8RzxM8EztvjTWyceACPpiqPmJzULOnRyPPwRRomd4apSh8StjXWOuvPI ayFtQswYOmpnTdoxOsoC2gvRWZ5ZINHTPJG176xKuq8+POLo5uE+rn6CX/z+0RxsuRjD GiKg== X-Gm-Message-State: ACrzQf0pL3X66VsaqCGIAttiB0BpwOha8ZG7moFMUh3766nvZKhkf0ZP ZdFEoebThpCzkUuKZrdNhTHPtCH8vfP4SGnn9t6z0vGe X-Google-Smtp-Source: AMsMyM5ISrDixaLaoAkiNOg7+TDHYbLNg/XyscIcUNiBGK7HIMoz1I0GS+yGWJ8eBYBAJoFSgJULJtEDYnWNiSPSIEA= X-Received: by 2002:a0d:ccc7:0:b0:345:5848:5feb with SMTP id o190-20020a0dccc7000000b0034558485febmr22498824ywd.302.1663744459610; Wed, 21 Sep 2022 00:14:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a81:7402:0:0:0:0:0 with HTTP; Wed, 21 Sep 2022 00:14:19 -0700 (PDT) In-Reply-To: References: From: Paul B Mahol Date: Wed, 21 Sep 2022 09:14:19 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH 15/17] avcodec/mlpenc: Remove dead channel layout checks 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 Cc: Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 9/18/22, Andreas Rheinhardt wrote: > ff_encode_preinit() has already checked that the channel layout > is equivalent to one of the layouts in AVCodec.ch_layouts. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/mlpenc.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > lgtm > diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c > index d2e28888f7..878c5aedc1 100644 > --- a/libavcodec/mlpenc.c > +++ b/libavcodec/mlpenc.c > @@ -27,6 +27,7 @@ > #include "encode.h" > #include "put_bits.h" > #include "audio_frame_queue.h" > +#include "libavutil/avassert.h" > #include "libavutil/channel_layout.h" > #include "libavutil/crc.h" > #include "libavutil/avstring.h" > @@ -602,12 +603,11 @@ static av_cold int mlp_encode_init(AVCodecContext > *avctx) > }; > int i; > > - for (i = 0; i < FF_ARRAY_ELEMS(layout_arrangement); i++) > + for (i = 0;; i++) { > + av_assert1(i < FF_ARRAY_ELEMS(layout_arrangement) || > + !"Impossible channel layout"); > if (channels_present == layout_arrangement[i]) > break; > - if (i == FF_ARRAY_ELEMS(layout_arrangement)) { > - av_log(avctx, AV_LOG_ERROR, "Unsupported channel > arrangement\n"); > - return AVERROR(EINVAL); > } > ctx->channel_arrangement = i; > ctx->flags = FLAGS_DVDA; > @@ -640,8 +640,7 @@ static av_cold int mlp_encode_init(AVCodecContext > *avctx) > ctx->channel_arrangement = 15; > ctx->thd_substream_info = 0x104; > } else { > - av_log(avctx, AV_LOG_ERROR, "Unsupported channel > arrangement\n"); > - return AVERROR(EINVAL); > + av_assert1(!"AVCodec.ch_layouts needs to be updated"); > } > ctx->flags = 0; > ctx->channel_occupancy = 0; > -- > 2.34.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".