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 346F34DF57 for ; Fri, 6 Jun 2025 00:15:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 0885268C153; Fri, 6 Jun 2025 03:14:53 +0300 (EEST) Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id A820268C03F for ; Fri, 6 Jun 2025 03:14:43 +0300 (EEST) Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-528ce9730cfso506222e0c.3 for ; Thu, 05 Jun 2025 17:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749168882; x=1749773682; 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=FCiy3hjQC0lgTwnVbaBz6Za90tlm9KUXLgKDq/dKLeM=; b=mQnwd9bVs9/LY6PZ/Nwt0DvLX8AzB4PE/nQoXZCufR6G2JEU4YHDt7DhlZ6sfep+jo p5qiWl0fKBjfJ2AAoT98+CUQKbb5YDZHCBL8s695yTNPxAhgLmQc0fvr/8HS9lfJTxeK rDUe8awUcxkefinwKvQXoOP556qOtpDTog5YT+yFCT2qH0IE2lQ2sBEIjld9BVvacGQS T1K2VoK8+iitgAET14OwyYyeBKp/r1vcy0frAud940mBS6vT1pKrjceP8de5/fwW3+yk O/K5hhd2WEUuteVH7U6hKrhP8XiTWr/SvrLnOx7rfYztvIvFJ1nJuSzCukW+60nDpDZB TCyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749168882; x=1749773682; 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=FCiy3hjQC0lgTwnVbaBz6Za90tlm9KUXLgKDq/dKLeM=; b=UjS/gVigz39InNUS09bS2cSXRpGrOGRY1vPex9jLdt/5CFV0DE2cGY+GbhZnYU5RR7 v+6trKD7wdyhTtUSZCgHOZEax80/EMPv2mk7PzCqYQ8G3ad+ZueZy3sECb9NDR8vKNyb Uni11q2Yq1zsoN/loyps/tShZqWRTsFFDBIu+BAH5WUkjwOZRzijcn5gG33gAvwp1qdw 5qmBeED929AMRqMqrdiyvch7O+i6dwCRjCeHBIvk0ypLO6iqeVroyg84bzzLtWxdWp0r VvCDXFIYjlWeQhF87In2D8htDPdx6zcIocRoEs1GLOZrSysxMCtrvGeOi9dDQCEin0V3 I1Hw== X-Gm-Message-State: AOJu0YyVFnvSQgi3BAVaFCspSPEK/xOe+zTvGqmRXQXbRzr58sGqG/PG RBJW9kv5rnEGIxLezXUB1t0slZNBFoheobaX8bAhbxqNCOzRqpJ8bjj3cQ4Bjw== X-Gm-Gg: ASbGnctM1i8f65mxIVDobjFJyD+GG99TOjl4goCOX+/ToZf/hu1hhYQgoJCBDxMBYp1 h1pGf6hgeDrlNMSCIPZJ79DiEIjqIFSZ0HohmVHtP1mLIh9HG++Jh6nDZEIx08IAjalQL/bRPvM wMM4chrkM7FdIC/lv4YgQPHQLh73Ru0x1AAMU67Vx+cZiR2saV/9JVz4vh+3ukeSkWrOlOxPifM oYz6ULukxQ3xRRZ7gPuA85a6qVO9G2rHcyrYp2sR8Wp0NsFDdRqZnFwUGAJ0X110NPUNdsRDs74 SxBOHyNipicy7+Ox/XszQFNeq+9LFcKFERELZrc5t+U7Gg7WZkD1wGyF3GcanXP5aapc/Bve77e lSBEowg== X-Google-Smtp-Source: AGHT+IFCBPGsHNriIaJbXWP1jHBu8skkQLW+HzIsMz6L3F2r5lg/ZeS2WeZj306uuZkVp6LIXVMXzA== X-Received: by 2002:a05:6122:130f:b0:530:7bd4:1761 with SMTP id 71dfb90a1353d-530e48a0013mr1674820e0c.11.1749168881976; Thu, 05 Jun 2025 17:14:41 -0700 (PDT) Received: from localhost.localdomain ([2800:2121:b000:82e:287b:4d06:66a8:d1a5]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-530e640ad09sm339169e0c.32.2025.06.05.17.14.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 17:14:41 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Jun 2025 21:14:17 -0300 Message-ID: <20250606001417.143552-4-jamrial@gmail.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250606001417.143552-1-jamrial@gmail.com> References: <20250606001417.143552-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 4/4] avformat/movenc: handle EAC-3 extension bits for Atmos 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: nyanmisaka Fixes commit #9996. Signed-off-by: James Almer --- libavformat/movenc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7bcdc2463d..cd5b45f6fe 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -393,6 +393,8 @@ struct eac3_info { uint16_t chan_loc; /* if there is no dependent substream, then one bit reserved instead */ } substream[1]; /* TODO: support 8 independent substreams */ + /* indicates the decoding complexity, 8 bits */ + uint8_t complexity_index_type_a; }; static int mov_write_ac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track) @@ -474,6 +476,8 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) info->data_rate = FFMAX(info->data_rate, hdr->bit_rate / 1000); info->ac3_bit_rate_code = FFMAX(info->ac3_bit_rate_code, hdr->ac3_bit_rate_code); + info->complexity_index_type_a = hdr->complexity_index_type_a; + num_blocks = hdr->num_blocks; if (!info->ec3_done) { @@ -601,7 +605,7 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra } info = track->eac3_priv; - size = 2 + ((34 * (info->num_ind_sub + 1) + 7) >> 3); + size = 2 + (4 * (info->num_ind_sub + 1)) + (2 * !!info->complexity_index_type_a); buf = av_malloc(size); if (!buf) { return AVERROR(ENOMEM); @@ -626,6 +630,11 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra put_bits(&pbc, 9, info->substream[i].chan_loc); } } + if (info->complexity_index_type_a) { + put_bits(&pbc, 7, 0); /* reserved */ + put_bits(&pbc, 1, 1); // flag_eac3_extension_type_a + put_bits(&pbc, 8, info->complexity_index_type_a); + } flush_put_bits(&pbc); size = put_bytes_output(&pbc); -- 2.49.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".