[FFmpeg-cvslog] avformat/iamf_writer: reject duplicated stream ids in a stream group
James Almer
git at videolan.org
Tue Apr 16 17:43:42 EEST 2024
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Apr 15 18:06:01 2024 -0300| [6b6a0fc53df592183c69e518967841272ab4e862] | committer: James Almer
avformat/iamf_writer: reject duplicated stream ids in a stream group
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6b6a0fc53df592183c69e518967841272ab4e862
---
libavformat/iamf_writer.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index 37ec8e732a..6d4e4082eb 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -275,6 +275,17 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void
}
}
+ for (int i = 0; i < audio_element->nb_substreams; i++) {
+ for (int j = i + 1; j < audio_element->nb_substreams; j++)
+ if (audio_element->substreams[i].audio_substream_id ==
+ audio_element->substreams[j].audio_substream_id) {
+ av_log(log_ctx, AV_LOG_ERROR, "Duplicate id %u in streams %u and %u from stream group %u\n",
+ audio_element->substreams[i].audio_substream_id, i, j, stg->index);
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+ }
+
if (iamf_audio_element->demixing_info) {
AVIAMFParamDefinition *param = iamf_audio_element->demixing_info;
const IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
More information about the ffmpeg-cvslog
mailing list