This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 16050a1cef818d02542ea52a14ad96ca890ffb2d
Author:     James Almer <[email protected]>
AuthorDate: Sun Dec 7 14:52:25 2025 -0300
Commit:     James Almer <[email protected]>
CommitDate: Tue Dec 9 17:54:11 2025 -0300

    avformat/iamf_writer: ensure expanded_loudspeaker_layout is only written 
when using a single scalable layout layer
    
    Signed-off-by: James Almer <[email protected]>
---
 libavformat/iamf_writer.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index e9dd170380..b917a15978 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -753,8 +753,16 @@ static int iamf_write_audio_element(const IAMFContext 
*iamf,
         int layout = 0, expanded_layout = 0;
         get_loudspeaker_layout(element->layers[0], &layout, &expanded_layout);
         /* When the loudspeaker_layout = 15, the type 
PARAMETER_DEFINITION_DEMIXING SHALL NOT be present. */
-        if (layout == 15)
+        if (layout == 15) {
             param_definition_types &= ~AV_IAMF_PARAMETER_DEFINITION_DEMIXING;
+            /* expanded_loudspeaker_layout SHALL only be present when 
num_layers = 1 and loudspeaker_layout is set to 15 */
+            if (element->nb_layers > 1) {
+                av_log(log_ctx, AV_LOG_ERROR, "expanded_loudspeaker_layout 
present when using more than one layer in "
+                                              "Stream Group #%u\n",
+                       audio_element->audio_element_id);
+                return AVERROR(EINVAL);
+            }
+        }
         /* When the loudspeaker_layout of the (non-)scalable channel audio 
(i.e., num_layers = 1) is less than or equal to 3.1.2ch,
          * (i.e., Mono, Stereo, or 3.1.2ch), the type 
PARAMETER_DEFINITION_DEMIXING SHALL NOT be present. */
         else if (element->nb_layers == 1 && (layout == 0 || layout == 1 || 
layout == 8))

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to