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 9267942CDF for ; Thu, 13 Jan 2022 01:59:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8B44168B07B; Thu, 13 Jan 2022 03:52:49 +0200 (EET) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5AD6268B03C for ; Thu, 13 Jan 2022 03:52:46 +0200 (EET) Received: by mail-qv1-f52.google.com with SMTP id p12so5080516qvj.6 for ; Wed, 12 Jan 2022 17:52:46 -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=hb3hm8lT4Ofnhm5y4sgpqIAweZr5zHgYT1AlUWxiRtc=; b=mGZYZrwStT2/oE15SSF2lbqaiqrZrvj9uAMpVNTIxbm5Kwst5XZ8ZKv0jC9Vo5mUaP 7YFROUJApKZ78kWGOtnsq/HEEK59XiknZCpb4s9+sMXncz4p0WBjsQP9rpa5hSqQhbQ7 oviXdBwhh5H8wFDxoeT7XT76qtehYzk38zK95/Rg6ED5bP5JxXeUBBMLFWrmz65XjPqr EuUyssl1+5K2Tc6F4ee4jSDRzIREOfjRXQacUnXRbN42vKJa1df6U1Y00Pn3FBux8Kgx INEA3mkqVy8m+lP1mU+Cx+IV6LOHue77XOHaXXnY6YZMNQK0lW2bFkVmrUo5ZCcVYkBJ tMXA== 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=hb3hm8lT4Ofnhm5y4sgpqIAweZr5zHgYT1AlUWxiRtc=; b=qPbv/LK0yr5fUrnE1BnRQrvXRBiMhgOo3h12NKbRy36qYvHqyOW+wkxdkkYm28NGaq cAfoWbidhck4n4kpobQG/b+w0Yyv7bOjZ1SStuOSppXIc9rBAuoAMQg7L5mpZrMAz11g j9UeL6tTzFpSH45aKuaVBTGjtAvRfcka0qaFbJEg8gmi8MXo3LY6ZQjiMZzV0OR2D39q OwRuTvWAJSA6XL0YLzfAZmCSRx5+ZeyU12LssthtrLGb5QA4lJxh++FPVPbFqFqn0HAX eLbPsskxNenh/bPGh1gulDsdP1f14QqCTXwV2ngU9Nb8CwzxHmELXFxru8+iNZm8Lz+i P1Ag== X-Gm-Message-State: AOAM530KMynnoa1Z/k23BCgDx+lQOFRO0xWUPzl+H5fsTgOoRhuYttdg lpU8NhoT5fYpPzLbNuyv7dak/ytifg8= X-Google-Smtp-Source: ABdhPJzhlW108R0D62UF2nbNdPOUnAqftBdxmX7cRvCvbp5BUKHkm3wL9Rjv61qwVYj7AbtgjkZn3Q== X-Received: by 2002:ad4:4a63:: with SMTP id cn3mr1255672qvb.23.1642038764641; Wed, 12 Jan 2022 17:52:44 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:44 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:49:59 -0300 Message-Id: <20220113015101.4-38-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 037/281] bink: 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: Vittorio Giovara Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/bink.c | 8 +++----- libavformat/binka.c | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libavformat/bink.c b/libavformat/bink.c index 6627a17e71..4f413bd986 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -186,11 +186,9 @@ static int read_header(AVFormatContext *s) ast->codecpar->codec_id = flags & BINK_AUD_USEDCT ? AV_CODEC_ID_BINKAUDIO_DCT : AV_CODEC_ID_BINKAUDIO_RDFT; if (flags & BINK_AUD_STEREO) { - ast->codecpar->channels = 2; - ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; + ast->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; } else { - ast->codecpar->channels = 1; - ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO; + ast->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO; } if ((ret = ff_alloc_extradata(ast->codecpar, 4)) < 0) return ret; @@ -283,7 +281,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) (in bytes). We use this value to calculate the audio PTS */ if (pkt->size >= 4) bink->audio_pts[bink->current_track -1] += - AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codecpar->channels); + AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codecpar->ch_layout.nb_channels); return 0; } else { avio_skip(pb, audio_size); diff --git a/libavformat/binka.c b/libavformat/binka.c index d4cfee0368..babd5e240a 100644 --- a/libavformat/binka.c +++ b/libavformat/binka.c @@ -44,7 +44,8 @@ static int binka_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_BINKAUDIO_DCT; - st->codecpar->channels = avio_r8(pb); + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = avio_r8(pb); st->codecpar->sample_rate = avio_rl16(pb); st->duration = avio_rl32(pb); -- 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".