aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-10-27 15:22:00 -0300
committerJames Almer <jamrial@gmail.com>2024-11-13 12:38:04 -0300
commitedc7b675082e84b39cfaad61eb93d500f53a7db6 (patch)
treed962a184ddf1b493189ec9d2e083187e362b31ca /libavformat
parent20af68b63a49e41b0b4233833230eff32778ad20 (diff)
downloadffmpeg-edc7b675082e84b39cfaad61eb93d500f53a7db6.tar.gz
avformat/iamf: use the new Binaural channel layout
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dump.c6
-rw-r--r--libavformat/iamf.c2
-rw-r--r--libavformat/iamf_parse.c3
-rw-r--r--libavformat/iamf_writer.c3
4 files changed, 9 insertions, 5 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 7dc7f0ad5a..b7125a652f 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -752,12 +752,12 @@ static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed,
for (int k = 0; k < sub_mix->nb_layouts; k++) {
const AVIAMFSubmixLayout *submix_layout = sub_mix->layouts[k];
av_log(NULL, AV_LOG_INFO, " Layout #%d:", k);
- if (submix_layout->layout_type == 2) {
+ if (submix_layout->layout_type == 2 ||
+ submix_layout->layout_type == 3) {
ret = av_channel_layout_describe(&submix_layout->sound_system, buf, sizeof(buf));
if (ret >= 0)
av_log(NULL, AV_LOG_INFO, " %s", buf);
- } else if (submix_layout->layout_type == 3)
- av_log(NULL, AV_LOG_INFO, " Binaural");
+ }
av_log(NULL, AV_LOG_INFO, "\n");
}
}
diff --git a/libavformat/iamf.c b/libavformat/iamf.c
index 5de70dc082..3fcf145a85 100644
--- a/libavformat/iamf.c
+++ b/libavformat/iamf.c
@@ -42,7 +42,7 @@ const AVChannelLayout ff_iamf_scalable_ch_layouts[10] = {
// Front subset of "Loudspeaker configuration for Sound System J"
AV_CHANNEL_LAYOUT_3POINT1POINT2,
// Binaural
- AV_CHANNEL_LAYOUT_STEREO,
+ AV_CHANNEL_LAYOUT_BINAURAL,
};
const struct IAMFSoundSystemMap ff_iamf_sound_system_map[13] = {
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index e0a138a07d..4aed894796 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -956,7 +956,8 @@ static int mix_presentation_obu(void *s, IAMFContext *c, AVIOContext *pb, int le
goto fail;
}
av_channel_layout_copy(&submix_layout->sound_system, &ff_iamf_sound_system_map[sound_system].layout);
- }
+ } else
+ submix_layout->sound_system = (AVChannelLayout)AV_CHANNEL_LAYOUT_BINAURAL;
info_type = avio_r8(pbc);
submix_layout->integrated_loudness = av_make_q(sign_extend(avio_rb16(pbc), 16), 1 << 8);
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index 1b620c38ee..7703729e07 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -817,6 +817,9 @@ static int iamf_write_mixing_presentation(const IAMFContext *iamf,
av_log(log_ctx, AV_LOG_ERROR, "Invalid Sound System value in a submix\n");
return AVERROR(EINVAL);
}
+ } else if (submix_layout->layout_type != AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL) {
+ av_log(log_ctx, AV_LOG_ERROR, "Unsupported Layout Type value in a submix\n");
+ return AVERROR(EINVAL);
}
init_put_bits(&pbc, header, sizeof(header));
put_bits(&pbc, 2, submix_layout->layout_type); // layout_type