1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avformat/iamf_writer: be more verbose when reporting an input layout is invalid

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2024-12-30 15:35:24 -03:00
parent aba9fafee7
commit 3fa70c03e4

View File

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/iamf.h"
@ -256,7 +257,13 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void
if (!av_channel_layout_compare(&layer->ch_layout, &ff_iamf_expanded_scalable_ch_layouts[j]))
break;
if (j >= FF_ARRAY_ELEMS(ff_iamf_expanded_scalable_ch_layouts)) {
av_log(log_ctx, AV_LOG_ERROR, "Unsupported channel layout in stream group #%d\n", i);
AVBPrint bp;
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
av_channel_layout_describe_bprint(&layer->ch_layout, &bp);
av_log(log_ctx, AV_LOG_ERROR, "Unsupported channel layout in Audio Element id %"PRId64
", Layer %d: %s\n",
stg->id, i, bp.str);
av_bprint_finalize(&bp, NULL);
return AVERROR(EINVAL);
}
}