[FFmpeg-cvslog] avformat/iamf_writer: constify some variables
James Almer
git at videolan.org
Tue Mar 5 16:39:43 EET 2024
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar 5 11:39:17 2024 -0300| [79c6ba900792fcf01a6e29bc7e924da222be2dab] | committer: James Almer
avformat/iamf_writer: constify some variables
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79c6ba900792fcf01a6e29bc7e924da222be2dab
---
libavformat/iamf_writer.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index 8a903a0397..37ec8e732a 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -277,7 +277,7 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void
if (iamf_audio_element->demixing_info) {
AVIAMFParamDefinition *param = iamf_audio_element->demixing_info;
- IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
+ const IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
if (param->nb_subblocks != 1) {
av_log(log_ctx, AV_LOG_ERROR, "nb_subblocks in demixing_info for stream group %u is not 1\n", stg->index);
@@ -293,7 +293,7 @@ int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void
}
if (iamf_audio_element->recon_gain_info) {
AVIAMFParamDefinition *param = iamf_audio_element->recon_gain_info;
- IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
+ const IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
if (param->nb_subblocks != 1) {
av_log(log_ctx, AV_LOG_ERROR, "nb_subblocks in recon_gain_info for stream group %u is not 1\n", stg->index);
@@ -495,7 +495,7 @@ static int scalable_channel_layout_config(const IAMFAudioElement *audio_element,
flush_put_bits(&pb);
avio_write(dyn_bc, header, put_bytes_count(&pb, 1));
for (int i = 0; i < element->nb_layers; i++) {
- AVIAMFLayer *layer = element->layers[i];
+ const AVIAMFLayer *layer = element->layers[i];
int layout;
for (layout = 0; layout < FF_ARRAY_ELEMS(ff_iamf_scalable_ch_layouts); layout++) {
if (!av_channel_layout_compare(&layer->ch_layout, &ff_iamf_scalable_ch_layouts[layout]))
@@ -524,7 +524,7 @@ static int ambisonics_config(const IAMFAudioElement *audio_element,
AVIOContext *dyn_bc)
{
const AVIAMFAudioElement *element = audio_element->celement;
- AVIAMFLayer *layer = element->layers[0];
+ const AVIAMFLayer *layer = element->layers[0];
ffio_write_leb(dyn_bc, 0); // ambisonics_mode
ffio_write_leb(dyn_bc, layer->ch_layout.nb_channels); // output_channel_count
@@ -857,7 +857,7 @@ static int write_parameter_block(const IAMFContext *iamf, AVIOContext *pb,
const AVIAMFParamDefinition *param, void *log_ctx)
{
uint8_t header[MAX_IAMF_OBU_HEADER_SIZE];
- IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
+ const IAMFParamDefinition *param_definition = ff_iamf_get_param_definition(iamf, param->parameter_id);
PutBitContext pbc;
AVIOContext *dyn_bc;
uint8_t *dyn_buf = NULL;
@@ -1034,7 +1034,8 @@ int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb,
uint8_t header[MAX_IAMF_OBU_HEADER_SIZE];
PutBitContext pbc;
AVIOContext *dyn_bc;
- uint8_t *side_data, *dyn_buf = NULL;
+ const uint8_t *side_data;
+ uint8_t *dyn_buf = NULL;
unsigned int skip_samples = 0, discard_padding = 0;
size_t side_data_size;
int dyn_size, type = audio_substream_id <= 17 ?
@@ -1042,12 +1043,12 @@ int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb,
int ret;
if (!pkt->size) {
- IAMFAudioElement *audio_element;
+ const IAMFAudioElement *audio_element;
IAMFCodecConfig *codec_config;
size_t new_extradata_size;
- uint8_t *new_extradata = av_packet_get_side_data(pkt,
- AV_PKT_DATA_NEW_EXTRADATA,
- &new_extradata_size);
+ const uint8_t *new_extradata = av_packet_get_side_data(pkt,
+ AV_PKT_DATA_NEW_EXTRADATA,
+ &new_extradata_size);
if (!new_extradata)
return AVERROR_INVALIDDATA;
More information about the ffmpeg-cvslog
mailing list