aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-07-18 18:56:54 -0300
committerJames Almer <jamrial@gmail.com>2024-07-18 23:27:20 -0300
commit54b8d5e201c97464625cfb6cfd851ed80976aa44 (patch)
treed7663edfe237a62b8e19d12ca1babb9223c1af56 /libavformat
parent2094f4029563d8fe5e62663bc04fc1f109448182 (diff)
downloadffmpeg-54b8d5e201c97464625cfb6cfd851ed80976aa44.tar.gz
avformat/iamf: rename Codec Config seek_preroll to audio_roll_distance
The semantics for the field are different than the one in AVCodecParameters, so use the name defined in the IAMF spec to prevent confusion. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/iamf.h2
-rw-r--r--libavformat/iamf_parse.c8
-rw-r--r--libavformat/iamf_writer.c8
3 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/iamf.h b/libavformat/iamf.h
index 68f05c635b..fd8b57a096 100644
--- a/libavformat/iamf.h
+++ b/libavformat/iamf.h
@@ -68,7 +68,7 @@ typedef struct IAMFCodecConfig {
enum AVCodecID codec_id;
uint32_t codec_tag;
unsigned nb_samples;
- int seek_preroll;
+ int audio_roll_distance;
int sample_rate;
int extradata_size;
uint8_t *extradata;
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index 2674a5186d..7ad3318833 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -166,7 +166,7 @@ static int codec_config_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
uint8_t *buf;
enum AVCodecID avcodec_id;
unsigned codec_config_id, nb_samples, codec_id;
- int16_t seek_preroll;
+ int16_t audio_roll_distance;
int ret;
buf = av_malloc(len);
@@ -186,7 +186,7 @@ static int codec_config_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
codec_config_id = ffio_read_leb(pbc);
codec_id = avio_rb32(pbc);
nb_samples = ffio_read_leb(pbc);
- seek_preroll = avio_rb16(pbc);
+ audio_roll_distance = avio_rb16(pbc);
switch(codec_id) {
case MKBETAG('O','p','u','s'):
@@ -225,7 +225,7 @@ static int codec_config_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
codec_config->codec_config_id = codec_config_id;
codec_config->codec_id = avcodec_id;
codec_config->nb_samples = nb_samples;
- codec_config->seek_preroll = seek_preroll;
+ codec_config->audio_roll_distance = audio_roll_distance;
switch(codec_id) {
case MKBETAG('O','p','u','s'):
@@ -683,7 +683,7 @@ static int audio_element_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
substream->codecpar->codec_id = codec_config->codec_id;
substream->codecpar->frame_size = codec_config->nb_samples;
substream->codecpar->sample_rate = codec_config->sample_rate;
- substream->codecpar->seek_preroll = -codec_config->seek_preroll * codec_config->nb_samples;
+ substream->codecpar->seek_preroll = -codec_config->audio_roll_distance * codec_config->nb_samples;
switch(substream->codecpar->codec_id) {
case AV_CODEC_ID_AAC:
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index 94bfffa95b..c955e1ecaf 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -79,10 +79,10 @@ static int populate_audio_roll_distance(IAMFCodecConfig *codec_config)
if (!codec_config->nb_samples)
return AVERROR(EINVAL);
// ceil(3840 / nb_samples)
- codec_config->seek_preroll = -(1 + ((3840 - 1) / codec_config->nb_samples));
+ codec_config->audio_roll_distance = -(1 + ((3840 - 1) / codec_config->nb_samples));
break;
case AV_CODEC_ID_AAC:
- codec_config->seek_preroll = -1;
+ codec_config->audio_roll_distance = -1;
break;
case AV_CODEC_ID_FLAC:
case AV_CODEC_ID_PCM_S16BE:
@@ -91,7 +91,7 @@ static int populate_audio_roll_distance(IAMFCodecConfig *codec_config)
case AV_CODEC_ID_PCM_S16LE:
case AV_CODEC_ID_PCM_S24LE:
case AV_CODEC_ID_PCM_S32LE:
- codec_config->seek_preroll = 0;
+ codec_config->audio_roll_distance = 0;
break;
default:
return AVERROR(EINVAL);
@@ -455,7 +455,7 @@ static int iamf_write_codec_config(const IAMFContext *iamf,
avio_wl32(dyn_bc, codec_config->codec_tag);
ffio_write_leb(dyn_bc, codec_config->nb_samples);
- avio_wb16(dyn_bc, codec_config->seek_preroll);
+ avio_wb16(dyn_bc, codec_config->audio_roll_distance);
switch(codec_config->codec_id) {
case AV_CODEC_ID_OPUS: