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 C74AF41A3E for ; Sat, 19 Mar 2022 01:08:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 24D8A68B0E0; Sat, 19 Mar 2022 03:08:05 +0200 (EET) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F97068AE62 for ; Sat, 19 Mar 2022 03:07:59 +0200 (EET) Received: by mail-oi1-f174.google.com with SMTP id n7so10606010oif.5 for ; Fri, 18 Mar 2022 18:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=8+nkoh53LzIgl0fJldT9lwhK3NmNxiMavx6qn54Vs0Y=; b=Qe1VkG9XAf9sb2JTZBXVxcxpJsca3ZudqAjzqhTlWQLMnsGFl5FtjOb4nYB1jZAPnv sRzslT0kx5/T5M84yqiuhDn4O336oFWMoLlyDLdEULwtmnuVVJRhkYlIIFC88lq3EHl8 Yh37+1A6wAV7xEtSXlgSunfpZlw/9JwEGMOWDPHMKjIHYqhjrcfXfHuwdj74gQ8gY8Q5 78H2DVbtXIDOyFZ9c40y3oO1wz9cv7dV21uDBPF9y6tvWahj1e/hzUDVz6ZWZKka/1xH IeEeR7UH5v316H0qcmvLqg2AC06B8HLwkLCJPKupbaSmU3ye+1XsWqYETkcUxX+EUm8B uD1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=8+nkoh53LzIgl0fJldT9lwhK3NmNxiMavx6qn54Vs0Y=; b=mpCNWP8+SmWQ/yvUDfuI70P2HWQRQv7E3B4xkBGupAcB/b9ajUb8dhRp1xPR2a2DJU WJk2la9PgSH48tvz5FhQUTvB1N10YyIALvijJQaidy+plilbhnv3MrlE5lrIdS0LDQ3S ymBrUSh47AY3qEGULio6AtRK5bL1sFuOdRtN11bbtoSPhglph5s3uNESzIIIRquWqtcg hO0VwxvFeyUtary0yD+MHtgpckw7qrJkEGEdP88+m4BxPpK6sl7+5rBQP/v3cAZvmUxi gN9+CM+eWNjOIbaEcGTj1/GrLQiaS3ZCWgEOg2/nRLb8oO8XroYtdu7kRY/Duq2PA0D7 8n3A== X-Gm-Message-State: AOAM5307/T3XBQRI1ABV5kDL5+rRvV0WoLHzDfEU8qIHxXzAOO8cV47o /79Okt649Z0wIzF7gC5lTWT7Hu5bVfRPdA== X-Google-Smtp-Source: ABdhPJx6vvuocuK7KPFY0Fj1QrlLM74R5hxjv2KVZMiFByHYab3p3Yzp4ZFywYYzARUcCzAJivU5Hw== X-Received: by 2002:a05:6808:11cc:b0:2d9:a01a:4ba6 with SMTP id p12-20020a05680811cc00b002d9a01a4ba6mr5594309oiv.205.1647652077391; Fri, 18 Mar 2022 18:07:57 -0700 (PDT) Received: from [192.168.0.13] ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id f7-20020aca3807000000b002eef684bd2fsm4639151oia.40.2022.03.18.18.07.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Mar 2022 18:07:56 -0700 (PDT) Message-ID: Date: Fri, 18 Mar 2022 22:07:55 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220319010333.35910-1-onemda@gmail.com> From: James Almer In-Reply-To: <20220319010333.35910-1-onemda@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/g723_1_parser: keep avctx channels internally if value is > 0 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 3/18/2022 10:03 PM, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavcodec/g723_1_parser.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/g723_1_parser.c b/libavcodec/g723_1_parser.c > index 2ed1a8ab19..03c165ce55 100644 > --- a/libavcodec/g723_1_parser.c > +++ b/libavcodec/g723_1_parser.c > @@ -26,6 +26,7 @@ > > typedef struct G723_1ParseContext { > ParseContext pc; > + int channels; > } G723_1ParseContext; > > static int g723_1_parse(AVCodecParserContext *s1, AVCodecContext *avctx, > @@ -36,8 +37,11 @@ static int g723_1_parse(AVCodecParserContext *s1, AVCodecContext *avctx, > ParseContext *pc = &s->pc; > int next = END_NOT_FOUND; > > + if (avctx->ch_layout.nb_channels > 0) > + s->channels = avctx->ch_layout.nb_channels; > + > if (buf_size > 0) > - next = frame_size[buf[0] & 3] * FFMAX(1, avctx->ch_layout.nb_channels); > + next = frame_size[buf[0] & 3] * FFMAX(1, s->channels); It would be nice to know why this is needed now but not before the channel layout set. > > if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) { > *poutbuf = NULL; _______________________________________________ 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".