From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 7C3E34F5BD for ; Wed, 18 Jun 2025 01:39:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 0449C68DC9D; Wed, 18 Jun 2025 04:39:30 +0300 (EEST) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id E359468D057 for ; Wed, 18 Jun 2025 04:39:22 +0300 (EEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-74877ac9d42so3968203b3a.1 for ; Tue, 17 Jun 2025 18:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750210760; x=1750815560; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Qb2lRP9cTaqPuOPhFXUGR/jttfcnYmUv3Wrtd/dXkrU=; b=SQ8t9924L5c9vxBuuwnwYPM8AIkJNkg0SqbbJnoT2x9kgAz8iZSoa3BEGgvzGMoYdK EB75S0cGz73Wx6fvQfWhEt3vmKrD75HuilSf7Lh2uHesGDv2kAIluSs+uOle63H+Vg0D UR6gi5zVg4JHBgXnMhnBwfgbHZupqWvnlfMqs8dmr3alpMOhjJkvq8BKAY/nzzV0+kwy vfHW7v/KErdXfugfekU8Xx6mB20bMA+JFZ9Q/UW+igv1JzvJGR13gfrunBC3CSNlDyQS zNy/iWa7Mis5/0it6T96XImQ8yQjN8sU5UCItDfxnFR0yBFkiiJf4qFT9TBI7aMChOxF qBfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750210760; x=1750815560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qb2lRP9cTaqPuOPhFXUGR/jttfcnYmUv3Wrtd/dXkrU=; b=N8U4cR2YEIHwW1YlfFXxN63/dvaFsCnwfirrTeF8nVqiaGn5+ap06jHtocl4FEQfqt VxxpjfCj+n1AQq7bNferSFkEg2e4CJreo5PHUlv+6sM3Zy7rxGWgXtL/kQbbA4CV58b7 bRLxsPOC9mGmWJw8ebdET+jUJbvVOnRme9V611gkIJAuhNQjrDgduBktdpE2XNs7CtOO h3wuCnaxmeSkyD2ukRzJqSgSVvJLigZMiW2XKdo734tV1z5GvYRxE5XQjbS0GZVch1Sd KRqEtxwzx0csQyY0ujd8eIwFDdFNDTk24GdL72MO2FTxkmf/E7DSvzIoawrVxrCsPyiH wcRQ== X-Gm-Message-State: AOJu0Yz5oEq0UotWdqfGnAZTrv4D1vCXMa1SpCXtZ36KUZPCTmmYPE8M 6iqmiZygtjhTIGEnicFA4LP5DHj0TSMTQb1lGR8Yeo7zrnmxpfP1wmlXXHCMzw== X-Gm-Gg: ASbGncvq8rZn+Kc7SjoY3GxNNoXnOMOWOJwDZs2gnZ4c/iocA9GLzXFcYhdb03xkve2 vG9jxVJXCI+2bdJ9hLZxFAeChGYMuwbmK6KFYNyiaF3h123vUA9WUKYSD16K5z5ZlnRB1Deqr3m nkI6akqOmwi3829IwdaxaMe2fc3ZNqyrxRcm/N5yXdl+tq+a7FJhq7jl+NUnr2wk0U9bZsUneu/ AJ0v4Kf6WlQxzzFFTlGIFLP0cSkUYqlxqxzQ4SWc/m6CcX7oHv7IyxvoB1VE1UfPbUJcABgJAd5 EdtmbpNpAV2rf96TKLBZIhyOHddYKI412ApzWDR8PmYFnTZxRMkV/LUeFOM= X-Google-Smtp-Source: AGHT+IEIJxv200RboKmSBWsjppGen2yk5NqAnYEYjZl7UBrmwM11BodAeq8i4OR1mgY/cPgyJFf8nQ== X-Received: by 2002:a05:6a00:4b4a:b0:742:3cc1:9485 with SMTP id d2e1a72fcca58-7489cfd5cb9mr20941823b3a.12.1750210760374; Tue, 17 Jun 2025 18:39:20 -0700 (PDT) Received: from Gryph ([2800:2121:b000:82e:746f:8b87:8ec9:3872]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-748e566bee6sm431865b3a.127.2025.06.17.18.39.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 18:39:19 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Jun 2025 22:38:57 -0300 Message-ID: <20250618013904.15638-2-jamrial@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250618013904.15638-1-jamrial@gmail.com> References: <20250618013904.15638-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/9] avformat/iamf_parse: try to retype the channel layout for ambisonics_mode == 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-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: In most cases, the channel ids will match the standard Ambisonic Order, saving us the need to use a custom order layout. Signed-off-by: James Almer --- libavformat/iamf_parse.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c index 71497876ac..f37edf5156 100644 --- a/libavformat/iamf_parse.c +++ b/libavformat/iamf_parse.c @@ -458,14 +458,16 @@ static int ambisonics_config(void *s, AVIOContext *pb, return ret; } - layer->ch_layout.order = AV_CHANNEL_ORDER_CUSTOM; - layer->ch_layout.nb_channels = output_channel_count; - layer->ch_layout.u.map = av_calloc(output_channel_count, sizeof(*layer->ch_layout.u.map)); - if (!layer->ch_layout.u.map) - return AVERROR(ENOMEM); + ret = av_channel_layout_custom_init(&layer->ch_layout, output_channel_count); + if (ret < 0) + return ret; for (int i = 0; i < output_channel_count; i++) layer->ch_layout.u.map[i].id = avio_r8(pb) + AV_CHAN_AMBISONIC_BASE; + + ret = av_channel_layout_retype(&layer->ch_layout, AV_CHANNEL_ORDER_AMBISONIC, 0); + if (ret < 0 && ret != AVERROR(ENOSYS)) + return ret; } else { int coupled_substream_count = avio_r8(pb); // M int nb_demixing_matrix = substream_count + coupled_substream_count; -- 2.50.0 _______________________________________________ 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".