avformat/iamf_parse: fix setting duration for the last subblock in a parameter definition
When subblock durations are constant, the last block may be smaller and the
value needs to be calculated.
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fb5e8ea971)
This commit is contained in:
parent
888a6b54bc
commit
871c69a28b
2 changed files with 4 additions and 2 deletions
|
|
@ -534,7 +534,8 @@ static int param_parse(void *s, IAMFContext *c, AVIOContext *pb,
|
|||
if (constant_subblock_duration == 0) {
|
||||
subblock_duration = ffio_read_leb(pb);
|
||||
total_duration += subblock_duration;
|
||||
}
|
||||
} else if (i == nb_subblocks - 1)
|
||||
subblock_duration = duration - i * constant_subblock_duration;
|
||||
|
||||
switch (type) {
|
||||
case AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN: {
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ static int parameter_block_obu(AVFormatContext *s, IAMFDemuxContext *c,
|
|||
if (!param_definition->mode && !constant_subblock_duration) {
|
||||
subblock_duration = ffio_read_leb(pb);
|
||||
total_duration += subblock_duration;
|
||||
}
|
||||
} else if (i == nb_subblocks - 1)
|
||||
subblock_duration = duration - i * constant_subblock_duration;
|
||||
|
||||
switch (param->type) {
|
||||
case AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue