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 7590D42EDA for ; Thu, 13 Jan 2022 02:36:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 81B9F68B749; Thu, 13 Jan 2022 04:03:24 +0200 (EET) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A80768B650 for ; Thu, 13 Jan 2022 04:03:20 +0200 (EET) Received: by mail-qv1-f50.google.com with SMTP id a8so5169012qvx.2 for ; Wed, 12 Jan 2022 18:03:20 -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=fjfxxFYV+1z3NbTgifteCpP714XFyDPJU9FJsnyXJRQ=; b=UbRkwJYDBzeJSTrrju7LJYvAgIilWt0Pqs9XqvbbFwyrWsqsn6rH3CedgSzsLnc+B8 i9tkubEcDYdoSYqjPREwnwZm49Xwt45dpc9XLRl+6wFSOlXmluYOBivuLpY0MkGhxBcR UMXYmZNzkLMhNFIFrBLqOFn5IY9RaPUREczVicP18uPCPjMTlkKvh4oymmlVT53YLDVh xZXmgM9s/fA/X7ESdYbAgKk447q0QbFbiimsH+QfFVb1+gdo+hpu4v5HlYh5IfK603Sm BEdcYlkhJJ3Ro5l9ekuuk1ek9P/nnrRdKm7Ro2jeyFhBFDwJgozo67fQX0OP61pz387b xP0Q== 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=fjfxxFYV+1z3NbTgifteCpP714XFyDPJU9FJsnyXJRQ=; b=QW59pSTJOqMTNr4YR999vx8xTIzmvgYKTrkzAwMlppBlNS7ArmLCYDliFHoFet2gFp BUDWujrIk6mVVPyUEhZDKdOaZYu3RfHe3znnibMmsz5vQQZxfvUjNbX2X5B2SNBKBJCz jQFac3V3II4e4QPeCSHvgWSaguw2mAJ7xxlAI+a5d9sVhoPqPvl2upjiUydTbP7GTOQM k/MPHTxVUB2FDS6zBXiALtK3dHB+4Y2kz1ukrT+pbN4v7CJghaBtMSBTjlSNuworIjTu 1k3oZOoTvSpL0bpEKUVoa7zE5lAifi8aChJuxCmvwOL71koATbgEmi3+c05xODfsikSf BfqQ== X-Gm-Message-State: AOAM532rZaQTRlyDZXZ0JlsU3c9Vg+MQM+2uj3YrU4AGv1BL28vIImNV J86ckYR0RTMXyz55HO2FThW/s5toS/c= X-Google-Smtp-Source: ABdhPJzuyoNFdcqT47AD9j9ATIvp3rghvhKTokE42x6gDKZuu2kkgASjKhQDQJqzJR328/lxb+2u6g== X-Received: by 2002:a05:6214:5096:: with SMTP id kk22mr2357972qvb.42.1642039399135; Wed, 12 Jan 2022 18:03:19 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id v1sm1045961qtc.95.2022.01.12.18.03.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:03:18 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 23:02:31 -0300 Message-Id: <20220113020242.661-19-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 198/281] cng: 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: James Almer --- libavcodec/cngdec.c | 3 ++- libavcodec/cngenc.c | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c index ecfd4abfc9..30d36f7326 100644 --- a/libavcodec/cngdec.c +++ b/libavcodec/cngdec.c @@ -56,7 +56,8 @@ static av_cold int cng_decode_init(AVCodecContext *avctx) CNGContext *p = avctx->priv_data; avctx->sample_fmt = AV_SAMPLE_FMT_S16; - avctx->channels = 1; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; avctx->sample_rate = 8000; p->order = 12; diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c index 830311f955..d77bbac40e 100644 --- a/libavcodec/cngenc.c +++ b/libavcodec/cngenc.c @@ -48,11 +48,6 @@ static av_cold int cng_encode_init(AVCodecContext *avctx) CNGContext *p = avctx->priv_data; int ret; - if (avctx->channels != 1) { - av_log(avctx, AV_LOG_ERROR, "Only mono supported\n"); - return AVERROR(EINVAL); - } - avctx->frame_size = 640; p->order = 10; if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0) @@ -113,5 +108,6 @@ const AVCodec ff_comfortnoise_encoder = { .close = cng_encode_close, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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".