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 F196844B86 for ; Sun, 6 Nov 2022 21:33:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B2B6668B5B3; Sun, 6 Nov 2022 23:33:45 +0200 (EET) Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC10368B5B3 for ; Sun, 6 Nov 2022 23:33:38 +0200 (EET) Received: by mail-oi1-f172.google.com with SMTP id g10so10407004oif.10 for ; Sun, 06 Nov 2022 13:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=XRpssqtcd+2m77l9Ej5pIrUCFZNk9tHCsiRSDoXghAs=; b=e3/C59mVZFtLgfA+zVoOe2a2/bl+PAxgmSWu/puN0fbsvzkHF9BV0hpXBUsCqP8Hx3 lNvfU7xNKOqO6dXsOrza/6qKw9jxRKEHT/QT9ODfjIMU/TBBK2YHJ5YnPFyvZZNud+JO zuXNQB2S6/6WbrT/oR/jws6UNiQ7XMSPO4XBshFMUOdwpv/36VXIiFqy9keUAEGvfQy7 aq5cvwM59gYXoRr2wJiG3Ep14/ffZp2pMzMclGuQqTKcDrh2Nws/nXI09gUiBTEwUGdc U9IIUhScE+zszvm9HesAadx1R0dJvTNj3GHoyrPE1quzrtoOJ4CVNv01fr4SmFB4poEO XPMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XRpssqtcd+2m77l9Ej5pIrUCFZNk9tHCsiRSDoXghAs=; b=ZKeMI8BpM8p9MgZU4wlawO9SJ8TcafZms/1XiHiALomT2OPjF3FUkao0fajVyBJf+y DdWXtmAmBtiADx5Afzw+bW9GKcWsHkI8eG57mXFr7xyhXknqUpccvwGIjpBmRKQ+jM5R 2r6YxRkF4sIkmdTAlaTiycwkuo3IfRxQEPsudCO9JoDvU0O4zHIwh78OwqMXqzegixTS v1cSba0vRPpH+XU7HAXVG++Z6CAzBGXpVRrSWAGdo9fCQnoqaOTBGJBi3gzB0cWcHLU0 UOHOthNfRGTbQuXJvCeepnGWeNKGEvgCpAOIoCIXCGrjF/nxo+ytyWDNgBfx6n4O/zN3 9lvg== X-Gm-Message-State: ACrzQf1+wxu0SvFEYGSWLhRUVtz5wp3VvyxyzppP8tbhBed0CcB7z5Q6 2UyRtZ1PqdfOOvCxeonvNFZCCh5LzeQ= X-Google-Smtp-Source: AMsMyM7qYgaiFmsSOTAAAwX1X1sGtkY9FBAbTfzssCkC18x1wCCgWY/e/cYBxHWVE01ofiukEkVuiQ== X-Received: by 2002:a05:6808:308b:b0:35a:5288:65ad with SMTP id bl11-20020a056808308b00b0035a528865admr10143526oib.219.1667770416777; Sun, 06 Nov 2022 13:33:36 -0800 (PST) Received: from localhost.localdomain ([181.85.72.69]) by smtp.gmail.com with ESMTPSA id p20-20020a056870569400b0013bc95650c8sm2231087oao.54.2022.11.06.13.33.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Nov 2022 13:33:36 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 6 Nov 2022 18:33:25 -0300 Message-Id: <20221106213326.5808-1-jamrial@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avdevice/audiotoolbox: 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: Signed-off-by: James Almer --- Untested. libavdevice/audiotoolbox.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavdevice/audiotoolbox.m b/libavdevice/audiotoolbox.m index 0cb97b5e46..27a1fd4a78 100644 --- a/libavdevice/audiotoolbox.m +++ b/libavdevice/audiotoolbox.m @@ -173,7 +173,7 @@ static av_cold int at_write_header(AVFormatContext *avctx) device_format.mFormatFlags |= (codecpar->codec_id == AV_CODEC_ID_PCM_S16BE) ? kAudioFormatFlagIsBigEndian : 0; device_format.mFormatFlags |= (codecpar->codec_id == AV_CODEC_ID_PCM_S24BE) ? kAudioFormatFlagIsBigEndian : 0; device_format.mFormatFlags |= (codecpar->codec_id == AV_CODEC_ID_PCM_S32BE) ? kAudioFormatFlagIsBigEndian : 0; - device_format.mChannelsPerFrame = codecpar->channels; + device_format.mChannelsPerFrame = codecpar->ch_layout.nb_channels; device_format.mBitsPerChannel = (codecpar->codec_id == AV_NE(AV_CODEC_ID_PCM_S24BE, AV_CODEC_ID_PCM_S24LE)) ? 24 : (av_get_bytes_per_sample(codecpar->format) << 3); device_format.mBytesPerFrame = (device_format.mBitsPerChannel >> 3) * device_format.mChannelsPerFrame; device_format.mFramesPerPacket = 1; @@ -193,9 +193,9 @@ static av_cold int at_write_header(AVFormatContext *avctx) av_log(ctx, AV_LOG_DEBUG, "device_format.mFormatFlags |= %s\n", (codecpar->codec_id == AV_CODEC_ID_PCM_S24BE) ? "kAudioFormatFlagIsBigEndian" : "0"); av_log(ctx, AV_LOG_DEBUG, "device_format.mFormatFlags |= %s\n", (codecpar->codec_id == AV_CODEC_ID_PCM_S32BE) ? "kAudioFormatFlagIsBigEndian" : "0"); av_log(ctx, AV_LOG_DEBUG, "device_format.mFormatFlags == %i\n", device_format.mFormatFlags); - av_log(ctx, AV_LOG_DEBUG, "device_format.mChannelsPerFrame = %i\n", codecpar->channels); + av_log(ctx, AV_LOG_DEBUG, "device_format.mChannelsPerFrame = %i\n", codecpar->ch_layout.nb_channels); av_log(ctx, AV_LOG_DEBUG, "device_format.mBitsPerChannel = %i\n", av_get_bytes_per_sample(codecpar->format) << 3); - av_log(ctx, AV_LOG_DEBUG, "device_format.mBytesPerFrame = %i\n", (device_format.mBitsPerChannel >> 3) * codecpar->channels); + av_log(ctx, AV_LOG_DEBUG, "device_format.mBytesPerFrame = %i\n", (device_format.mBitsPerChannel >> 3) * codecpar->ch_layout.nb_channels); av_log(ctx, AV_LOG_DEBUG, "device_format.mBytesPerPacket = %i\n", device_format.mBytesPerFrame); av_log(ctx, AV_LOG_DEBUG, "device_format.mFramesPerPacket = %i\n", 1); av_log(ctx, AV_LOG_DEBUG, "device_format.mReserved = %i\n", 0); -- 2.38.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".