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 37EBE42E67 for ; Thu, 13 Jan 2022 02:35:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C231C68B656; Thu, 13 Jan 2022 04:03:20 +0200 (EET) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 98E9C68B5F7 for ; Thu, 13 Jan 2022 04:03:15 +0200 (EET) Received: by mail-qk1-f170.google.com with SMTP id 193so4880981qkh.13 for ; Wed, 12 Jan 2022 18:03:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pU/PmLFZnO9e3s4HKHPVWgmdNFGJoXX9lSQGgm2u12s=; b=jrTP0BUhTR8fHt+m1K8C5VHOOkwTzN4UBOJa6GuRpvjyDx1kBEfziDKt490hDpf+Gg AkcMTlwHXz2TzTNb7NzicTJIEGR1cTLqSR9UwUzeFVrYKsHJxyMJNet5CuYF7Hm4dtOr Uw3CfjoT26YlBYB3D0JQJNrnqJ3kEAv08j/FL27pyMg8ppDXFQfzYPS6N3LCWFUMMko+ J6e6/5XgIYfhmKBBHW/gRIInf+7rfnbuTx4crd5qaCkAsKEiTND2pWFXfy/Ey+MMxrFQ QBwSjbAn32OHuxyZlWysnhKUqqQQZxClLYfCXtuIzYicXsjWvTVzr88EKSClyTj9F5q2 YKNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pU/PmLFZnO9e3s4HKHPVWgmdNFGJoXX9lSQGgm2u12s=; b=HJ7iK0jN/BQgjPlteRAOjTQIxHDgdPBmC5kom/w4YAvO50h3ihXvu1KVnjqNKKzeqE fLhmWoZ+RiJwAo5cg8JQ28KMBHHL1fifhmXR+r1P0bIcHv5dSc7yiKZZdw5Qm5xMtlLR T34ptAf/G+NgzQ3gMMtqp8mi7uHbKtkve7UJ3e6E/b6faC5urDGQXqjUGk3Aa1LW1Ps2 oE2AZ0OqgAsjgelNhJ0iCp4GY8ym/Uahgy8NjdK0yJM2lTSsDhn4Co+bydtwhhF32XWn 40g7vFhKnJ37Q/92HgjR8jYvMb/4Iv97PrJTW+NmMu89uzaok1ROSiKtsUZxWn2+LChf W+vw== X-Gm-Message-State: AOAM532wubNH6lJV3xwlBUPPDTJEYwuPBvD3O45ramSx/zX6IwhMkgES MBSX8cnJ9Jn/etxDNWKR9tYLdT9jPAo= X-Google-Smtp-Source: ABdhPJyw1STVCKocEfBRfIagsBmLu0FfuYdp4O3vrThPpLJbm3hL6VcCC5YzXPNi6H1JFV/N4KMmDw== X-Received: by 2002:a37:848:: with SMTP id 69mr1826045qki.638.1642039394192; Wed, 12 Jan 2022 18:03:14 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id v1sm1045961qtc.95.2022.01.12.18.03.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:03:13 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:02:27 -0300 Message-Id: <20220113020242.661-15-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113015101.4-1-jamrial@gmail.com> References: <20220113015101.4-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 194/281] apedec: convert to new channel layout API 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 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: From: Anton Khirnov Signed-off-by: Vittorio Giovara Signed-off-by: Anton Khirnov Signed-off-by: James Almer --- libavcodec/apedec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 607304fe36..46a53bc52d 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -233,13 +233,14 @@ static av_cold int ape_decode_close(AVCodecContext *avctx) static av_cold int ape_decode_init(AVCodecContext *avctx) { APEContext *s = avctx->priv_data; + int channels = avctx->ch_layout.nb_channels; int i; if (avctx->extradata_size != 6) { av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n"); return AVERROR(EINVAL); } - if (avctx->channels > 2) { + if (channels > 2) { av_log(avctx, AV_LOG_ERROR, "Only mono and stereo is supported\n"); return AVERROR(EINVAL); } @@ -261,7 +262,7 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) return AVERROR_PATCHWELCOME; } s->avctx = avctx; - s->channels = avctx->channels; + s->channels = channels; s->fileversion = AV_RL16(avctx->extradata); s->compression_level = AV_RL16(avctx->extradata + 2); s->flags = AV_RL16(avctx->extradata + 4); @@ -313,7 +314,9 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) ff_bswapdsp_init(&s->bdsp); ff_llauddsp_init(&s->adsp); - avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (channels == 2) ? (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO + : (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; return 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".