mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-21 21:30:24 +08:00
avformat/iamf_writer: check that stream count is consistent for ambisonic Audio Elements
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit a0fc454871)
This commit is contained in:
@@ -659,8 +659,12 @@ static int ambisonics_config(const IAMFAudioElement *audio_element,
|
||||
AVIOContext *dyn_bc)
|
||||
{
|
||||
const AVIAMFAudioElement *element = audio_element->celement;
|
||||
const IAMFLayer *ilayer = &audio_element->layers[0];
|
||||
const AVIAMFLayer *layer = element->layers[0];
|
||||
|
||||
if (audio_element->nb_substreams != ilayer->substream_count)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
ffio_write_leb(dyn_bc, 0); // ambisonics_mode
|
||||
avio_w8(dyn_bc, layer->ch_layout.nb_channels); // output_channel_count
|
||||
avio_w8(dyn_bc, audio_element->nb_substreams); // substream_count
|
||||
|
||||
Reference in New Issue
Block a user