PR #26246 opened by Jun Zhao (mypopydev)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26246
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26246.patch

This patchset fixes audio frame-size handling in ffmpeg CLI (fftools):

Don't override fixed-frame-size encoders with the input frame size 
(fftools/ffmpeg_enc.c): Restrict inheriting frame->nb_samples into 
AVCodecContext.frame_size to AV_CODEC_CAP_VARIABLE_FRAME_SIZE encoders with 
AV_CODEC_FLAG2_FIXED_FRAME_SIZE requested (e.g. PCM in IAMF). Encoders such as 
FLAC and WavPack again choose their own block size during init instead of 
inheriting small decoder frame sizes (such as TrueHD's 40 samples), fixing 
#26245, and affected FATE references are updated accordingly.

Account for user fixed-size options when creating sync queues 
(fftools/ffmpeg_mux_init.c): Check enc_ctx->frame_size and enc_ctx->flags2 in 
addition to Encoder.flags2 in setup_sync_queues(), preventing scheduler 
assertion aborts when -flags2 +fixed_frame_size or -frame_size is passed to a 
variable-frame-size encoder.

Add FATE coverage (tests/fate/): Add fate-audio-enc-flac-blocksize, 
fate-ffmpeg-fixed-frame-size, and fate-ffmpeg-user-frame-size (no external 
samples required).


>From ec996f452fe7162a6732435dde342d13d5b129e3 Mon Sep 17 00:00:00 2001
From: Jun Zhao <[email protected]>
Date: Sat, 21 Nov 2026 18:07:59 +0800
Subject: [PATCH 1/4] fftools/ffmpeg_enc: don't impose the decoder's frame size
 on encoders

Since 8e162daf9a, ffmpeg sets AVCodecContext.frame_size from the first
input frame for all non-variable-frame-size encoders and whenever
AV_CODEC_FLAG2_FIXED_FRAME_SIZE is set. This overrides the default block
size chosen by encoders such as FLAC and WavPack during init (e.g.
forcing 40-sample blocks when transcoding TrueHD to FLAC, or failing init
for very small input frames).

Only inherit frame->nb_samples when AV_CODEC_FLAG2_FIXED_FRAME_SIZE is
requested on an AV_CODEC_CAP_VARIABLE_FRAME_SIZE encoder (e.g. PCM in
IAMF). Fixed-frame-size encoders always set frame_size in init unless the
user specifies -frame_size.

Update affected FATE references accordingly.

Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/26245
Signed-off-by: Jun Zhao <[email protected]>
---
 fftools/ffmpeg_enc.c                          |   9 +-
 tests/ref/acodec/flac                         |   4 +-
 tests/ref/acodec/flac-exact-rice              |   4 +-
 tests/ref/acodec/wavpack                      |   4 +-
 tests/ref/fate/cover-art-flac-remux           |  24 +-
 .../ref/fate/generic-tags-remux-vorbiscomment |   4 +-
 tests/ref/fate/iamf-5_1_4                     | 148 ++++++-----
 tests/ref/fate/iamf-7_1_4                     | 171 ++++++-------
 tests/ref/fate/iamf-9_1_6                     | 234 +++++++++---------
 tests/ref/fate/iamf-ambisonic_1               |  96 ++++---
 tests/ref/fate/iamf-ambisonic_1-projection    |  96 ++++---
 tests/ref/fate/iamf-stereo                    |  27 +-
 tests/ref/fate/matroska-flac-extradata-update |  58 ++---
 tests/ref/fate/mov-mp4-iamf-5_1_4             | 148 ++++++-----
 tests/ref/fate/mov-mp4-iamf-7_1_4-video-first | 167 ++++++-------
 .../ref/fate/mov-mp4-iamf-7_1_4-video-first-2 |  23 +-
 .../ref/fate/mov-mp4-iamf-7_1_4-video-first-3 |  23 +-
 tests/ref/fate/mov-mp4-iamf-7_1_4-video-last  | 171 ++++++-------
 tests/ref/fate/mov-mp4-iamf-ambisonic_1       |  96 ++++---
 tests/ref/fate/mov-mp4-iamf-stereo            |  27 +-
 .../ref/fate/mov-mp4-iamf-stereo-id-collision |  50 ++--
 .../ref/fate/mov-reenc-delete-stream-metadata |   4 +-
 ...ov-reenc-delete-stream-metadata-global-tag |   4 +-
 tests/ref/fate/ogg-flac-chained-bps           |  54 +---
 tests/ref/lavf/wv                             |   4 +-
 tests/ref/seek/acodec-flac                    |  54 ++--
 26 files changed, 806 insertions(+), 898 deletions(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 37e67b78cef..c8439856137 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -296,8 +296,13 @@ static int enc_reopen(void *opaque, const AVFrame *frame,
                    frame->ch_layout.nb_channels > 0);
         enc_ctx->sample_fmt     = frame->format;
         enc_ctx->sample_rate    = frame->sample_rate;
-        if (!enc_ctx->frame_size && (!(enc->capabilities & 
AV_CODEC_CAP_VARIABLE_FRAME_SIZE) ||
-                                      (enc_ctx->flags2 & 
AV_CODEC_FLAG2_FIXED_FRAME_SIZE)))
+        /* Leave frame_size to the encoder unless fixed-size frames were
+         * explicitly requested for a variable-frame-size encoder; the
+         * decoder's frame size must not override the block size chosen by
+         * encoders (e.g. FLAC/WavPack) during their init. */
+        if (!enc_ctx->frame_size &&
+            (enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) &&
+            (enc_ctx->flags2 & AV_CODEC_FLAG2_FIXED_FRAME_SIZE))
             enc_ctx->frame_size = frame->nb_samples;
         ret = av_channel_layout_copy(&enc_ctx->ch_layout, &frame->ch_layout);
         if (ret < 0)
diff --git a/tests/ref/acodec/flac b/tests/ref/acodec/flac
index 7b67e5dc641..c2e7f2099bd 100644
--- a/tests/ref/acodec/flac
+++ b/tests/ref/acodec/flac
@@ -1,4 +1,4 @@
-eb908cfce45d1b11408be4387472ae92 *tests/data/fate/acodec-flac.flac
-363881 tests/data/fate/acodec-flac.flac
+151eef9097f944726968bec48649f00a *tests/data/fate/acodec-flac.flac
+361582 tests/data/fate/acodec-flac.flac
 95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-flac.out.wav
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/tests/ref/acodec/flac-exact-rice b/tests/ref/acodec/flac-exact-rice
index 60bb76464a1..6f6d27427dc 100644
--- a/tests/ref/acodec/flac-exact-rice
+++ b/tests/ref/acodec/flac-exact-rice
@@ -1,4 +1,4 @@
-eb3bddd3a7ab504981bc2725f6c2eb65 *tests/data/fate/acodec-flac-exact-rice.flac
-362904 tests/data/fate/acodec-flac-exact-rice.flac
+aab144de213ae684ca008a3e0afe5e28 *tests/data/fate/acodec-flac-exact-rice.flac
+360454 tests/data/fate/acodec-flac-exact-rice.flac
 95e54b261530a1bcf6de6fe3b21dc5f6 
*tests/data/fate/acodec-flac-exact-rice.out.wav
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/tests/ref/acodec/wavpack b/tests/ref/acodec/wavpack
index 35bca6433bc..02f09ae5ed1 100644
--- a/tests/ref/acodec/wavpack
+++ b/tests/ref/acodec/wavpack
@@ -1,4 +1,4 @@
-72604d44fff5d797cd1e421c384e659f *tests/data/fate/acodec-wavpack.wv
-343032 tests/data/fate/acodec-wavpack.wv
+000420796cc3e526650ce6f4c6334471 *tests/data/fate/acodec-wavpack.wv
+338166 tests/data/fate/acodec-wavpack.wv
 95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-wavpack.out.wav
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/tests/ref/fate/cover-art-flac-remux 
b/tests/ref/fate/cover-art-flac-remux
index fad8a942725..20dd49e0cec 100644
--- a/tests/ref/fate/cover-art-flac-remux
+++ b/tests/ref/fate/cover-art-flac-remux
@@ -1,6 +1,6 @@
-61963e1df31cfa046f99d971a465d364 *tests/data/fate/cover-art-flac-remux.flac
-964133 tests/data/fate/cover-art-flac-remux.flac
-#extradata 0:       34, 0x8f1f0acf
+a463bc42f27b42efecc8eb6b0c8b4c18 *tests/data/fate/cover-art-flac-remux.flac
+964036 tests/data/fate/cover-art-flac-remux.flac
+#extradata 0:       34, 0x8d830abd
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -36,21 +36,19 @@
 #codec_id 6: pcm_s16le
 #sample_rate 6: 44100
 #channel_layout_name 6: 2 channels (FL+FC)
-0,          0,          0,     4096,       14, 0x2e2e0540
+0,          0,          0,     4608,       14, 0x242b036d
 1,          0,          0,        0,    66888, 0x1fd72743
 2,          0,          0,        0,   304403, 0xaf7c7667
 3,          0,          0,        0,    21671, 0x7d1c6030
 4,          0,          0,        0,   522758, 0x7a63572f
 5,          0,          0,        0,    21671, 0x7d1c6030
-6,          0,          0,     4096,    16384, 0x00000000
-0,       4096,       4096,     4096,     6128, 0x2072ccde
-6,       4096,       4096,     4096,    16384, 0x29cd639d
-0,       8192,       8192,     4096,     5361, 0xe7316a81
-6,       8192,       8192,     4096,    16384, 0xd52066e5
-0,      12288,      12288,     4096,     5015, 0x366ffd34
-6,      12288,      12288,     4096,    16384, 0x0c933408
-0,      16384,      16384,     1256,     1441, 0x44376426
-6,      16384,      16384,     1256,     5024, 0xde7bbab0
+6,          0,          0,     4608,    18432, 0x00000000
+0,       4608,       4608,     4608,     7636, 0xc3775d85
+6,       4608,       4608,     4608,    18432, 0xaaab4d62
+0,       9216,       9216,     4608,     5700, 0x8b9a3cc7
+6,       9216,       9216,     4608,    18432, 0x49410f52
+0,      13824,      13824,     3816,     4512, 0x0ded5f71
+6,      13824,      13824,     3816,    15264, 0x155b5c95
 [STREAM]
 index=0
 codec_name=flac
diff --git a/tests/ref/fate/generic-tags-remux-vorbiscomment 
b/tests/ref/fate/generic-tags-remux-vorbiscomment
index 73ebba45a52..0ce826e01fd 100644
--- a/tests/ref/fate/generic-tags-remux-vorbiscomment
+++ b/tests/ref/fate/generic-tags-remux-vorbiscomment
@@ -1,6 +1,6 @@
-00ad19f1aff315184c627fa2edb0c225 
*tests/data/fate/generic-tags-remux-vorbiscomment.flac
+2b422cc2dfacba5dbe8cb836cb50d0f4 
*tests/data/fate/generic-tags-remux-vorbiscomment.flac
 8628 tests/data/fate/generic-tags-remux-vorbiscomment.flac
-#extradata 0:       34, 0x93a20b79
+#extradata 0:       34, 0x801e0acb
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
diff --git a/tests/ref/fate/iamf-5_1_4 b/tests/ref/fate/iamf-5_1_4
index 7f5bd930ed9..69f28fbb079 100644
--- a/tests/ref/fate/iamf-5_1_4
+++ b/tests/ref/fate/iamf-5_1_4
@@ -1,11 +1,11 @@
-9a64dd4f370f0d89cd2462e3683e689d *tests/data/fate/iamf-5_1_4.iamf
-85423 tests/data/fate/iamf-5_1_4.iamf
-#extradata 0:       34, 0xa77c0cd6
-#extradata 1:       34, 0xa77c0cd6
-#extradata 2:       34, 0xa7500cd4
-#extradata 3:       34, 0xa7500cd4
-#extradata 4:       34, 0xa77c0cd6
-#extradata 5:       34, 0xa77c0cd6
+0dde02e8a5cc33e01403b0a1a4a9e524 *tests/data/fate/iamf-5_1_4.iamf
+93817 tests/data/fate/iamf-5_1_4.iamf
+#extradata 0:       34, 0x90430a91
+#extradata 1:       34, 0x90430a91
+#extradata 2:       34, 0x90170a8f
+#extradata 3:       34, 0x90170a8f
+#extradata 4:       34, 0x90430a91
+#extradata 5:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -36,72 +36,66 @@
 #codec_id 5: flac
 #sample_rate 5: 44100
 #channel_layout_name 5: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-4,          0,          0,     4096,     1323, 0xb9bc0f9a
-5,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-4,       4096,       4096,     4096,     1254, 0xf7e910bc
-5,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-4,       8192,       8192,     4096,     1320, 0xe4fe09c9
-5,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-4,      12288,      12288,     4096,     1280, 0x22e9127e
-5,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-4,      16384,      16384,     4096,     1331, 0x8bc61bbf
-5,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-4,      20480,      20480,     4096,     1267, 0x2c4708fa
-5,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-1,      24576,      24576,     4096,     1282, 0x0438152d
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-4,      24576,      24576,     4096,     1282, 0x0438152d
-5,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-4,      28672,      28672,     4096,     1313, 0x2e79ffa2
-5,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-4,      32768,      32768,     4096,     1323, 0xb9f70fce
-5,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-4,      36864,      36864,     4096,     1254, 0xf6f01051
-5,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-4,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-5,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+1,          0,          0,     4608,     1399, 0x6e89566e
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+4,          0,          0,     4608,     1399, 0x6e89566e
+5,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+4,       4608,       4608,     4608,     1442, 0x6c3c5b13
+5,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+1,       9216,       9216,     4608,     1380, 0xc497571b
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+4,       9216,       9216,     4608,     1380, 0xc497571b
+5,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+4,      13824,      13824,     4608,     1383, 0x48e9510f
+5,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+1,      18432,      18432,     4608,     1572, 0x9a514719
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+4,      18432,      18432,     4608,     1572, 0x9a514719
+5,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+4,      23040,      23040,     4608,     1391, 0x74ac5014
+5,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+4,      27648,      27648,     4608,     1422, 0x2f9d47c5
+5,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+4,      32256,      32256,     4608,     1768, 0x2a044b99
+5,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+4,      36864,      36864,     4608,     1534, 0xb0b35a3f
+5,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+4,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+5,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
@@ -137,10 +131,10 @@ nb_subblocks=1
 type=1
 parameter_id=998
 parameter_rate=44100
-duration=4096
-constant_subblock_duration=4096
+duration=4608
+constant_subblock_duration=4608
 [PIECE]
-subblock_duration=4096
+subblock_duration=4608
 dmixp_mode=1
 [/PIECE]
 [/SUBCOMPONENT]
diff --git a/tests/ref/fate/iamf-7_1_4 b/tests/ref/fate/iamf-7_1_4
index b0e7ee604c8..c3115dcb55a 100644
--- a/tests/ref/fate/iamf-7_1_4
+++ b/tests/ref/fate/iamf-7_1_4
@@ -1,12 +1,12 @@
-78063ed53103369b68902d315c545495 *tests/data/fate/iamf-7_1_4.iamf
-99642 tests/data/fate/iamf-7_1_4.iamf
-#extradata 0:       34, 0xa77c0cd6
-#extradata 1:       34, 0xa77c0cd6
-#extradata 2:       34, 0xa7500cd4
-#extradata 3:       34, 0xa7500cd4
-#extradata 4:       34, 0xa77c0cd6
-#extradata 5:       34, 0xa77c0cd6
-#extradata 6:       34, 0xa77c0cd6
+6bd8560bc044e5028ff0090275482f49 *tests/data/fate/iamf-7_1_4.iamf
+109434 tests/data/fate/iamf-7_1_4.iamf
+#extradata 0:       34, 0x90430a91
+#extradata 1:       34, 0x90430a91
+#extradata 2:       34, 0x90170a8f
+#extradata 3:       34, 0x90170a8f
+#extradata 4:       34, 0x90430a91
+#extradata 5:       34, 0x90430a91
+#extradata 6:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -42,83 +42,76 @@
 #codec_id 6: flac
 #sample_rate 6: 44100
 #channel_layout_name 6: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-4,          0,          0,     4096,     1323, 0xb9bc0f9a
-5,          0,          0,     4096,     1323, 0xb9bc0f9a
-6,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-4,       4096,       4096,     4096,     1254, 0xf7e910bc
-5,       4096,       4096,     4096,     1254, 0xf7e910bc
-6,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-4,       8192,       8192,     4096,     1320, 0xe4fe09c9
-5,       8192,       8192,     4096,     1320, 0xe4fe09c9
-6,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-4,      12288,      12288,     4096,     1280, 0x22e9127e
-5,      12288,      12288,     4096,     1280, 0x22e9127e
-6,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-4,      16384,      16384,     4096,     1331, 0x8bc61bbf
-5,      16384,      16384,     4096,     1331, 0x8bc61bbf
-6,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-4,      20480,      20480,     4096,     1267, 0x2c4708fa
-5,      20480,      20480,     4096,     1267, 0x2c4708fa
-6,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-1,      24576,      24576,     4096,     1282, 0x0438152d
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-4,      24576,      24576,     4096,     1282, 0x0438152d
-5,      24576,      24576,     4096,     1282, 0x0438152d
-6,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-4,      28672,      28672,     4096,     1313, 0x2e79ffa2
-5,      28672,      28672,     4096,     1313, 0x2e79ffa2
-6,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-4,      32768,      32768,     4096,     1323, 0xb9f70fce
-5,      32768,      32768,     4096,     1323, 0xb9f70fce
-6,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-4,      36864,      36864,     4096,     1254, 0xf6f01051
-5,      36864,      36864,     4096,     1254, 0xf6f01051
-6,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-4,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-5,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-6,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+1,          0,          0,     4608,     1399, 0x6e89566e
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+4,          0,          0,     4608,     1399, 0x6e89566e
+5,          0,          0,     4608,     1399, 0x6e89566e
+6,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+4,       4608,       4608,     4608,     1442, 0x6c3c5b13
+5,       4608,       4608,     4608,     1442, 0x6c3c5b13
+6,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+1,       9216,       9216,     4608,     1380, 0xc497571b
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+4,       9216,       9216,     4608,     1380, 0xc497571b
+5,       9216,       9216,     4608,     1380, 0xc497571b
+6,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+4,      13824,      13824,     4608,     1383, 0x48e9510f
+5,      13824,      13824,     4608,     1383, 0x48e9510f
+6,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+1,      18432,      18432,     4608,     1572, 0x9a514719
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+4,      18432,      18432,     4608,     1572, 0x9a514719
+5,      18432,      18432,     4608,     1572, 0x9a514719
+6,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+4,      23040,      23040,     4608,     1391, 0x74ac5014
+5,      23040,      23040,     4608,     1391, 0x74ac5014
+6,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+4,      27648,      27648,     4608,     1422, 0x2f9d47c5
+5,      27648,      27648,     4608,     1422, 0x2f9d47c5
+6,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+4,      32256,      32256,     4608,     1768, 0x2a044b99
+5,      32256,      32256,     4608,     1768, 0x2a044b99
+6,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+4,      36864,      36864,     4608,     1534, 0xb0b35a3f
+5,      36864,      36864,     4608,     1534, 0xb0b35a3f
+6,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+4,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+5,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+6,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
@@ -154,10 +147,10 @@ nb_subblocks=1
 type=1
 parameter_id=998
 parameter_rate=44100
-duration=4096
-constant_subblock_duration=4096
+duration=4608
+constant_subblock_duration=4608
 [PIECE]
-subblock_duration=4096
+subblock_duration=4608
 dmixp_mode=1
 [/PIECE]
 [/SUBCOMPONENT]
diff --git a/tests/ref/fate/iamf-9_1_6 b/tests/ref/fate/iamf-9_1_6
index f2cc676b0c4..6bef55dcc1b 100644
--- a/tests/ref/fate/iamf-9_1_6
+++ b/tests/ref/fate/iamf-9_1_6
@@ -1,15 +1,15 @@
-ced4047d684733bf84e7796704b49502 *tests/data/fate/iamf-9_1_6.iamf
-142298 tests/data/fate/iamf-9_1_6.iamf
-#extradata 0:       34, 0xa77c0cd6
-#extradata 1:       34, 0xa77c0cd6
-#extradata 2:       34, 0xa77c0cd6
-#extradata 3:       34, 0xa77c0cd6
-#extradata 4:       34, 0xa77c0cd6
-#extradata 5:       34, 0xa77c0cd6
-#extradata 6:       34, 0xa77c0cd6
-#extradata 7:       34, 0xa7500cd4
-#extradata 8:       34, 0xa7500cd4
-#extradata 9:       34, 0xa77c0cd6
+785c19238e35218a2491758413d278de *tests/data/fate/iamf-9_1_6.iamf
+156284 tests/data/fate/iamf-9_1_6.iamf
+#extradata 0:       34, 0x90430a91
+#extradata 1:       34, 0x90430a91
+#extradata 2:       34, 0x90430a91
+#extradata 3:       34, 0x90430a91
+#extradata 4:       34, 0x90430a91
+#extradata 5:       34, 0x90430a91
+#extradata 6:       34, 0x90430a91
+#extradata 7:       34, 0x90170a8f
+#extradata 8:       34, 0x90170a8f
+#extradata 9:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -60,116 +60,106 @@ ced4047d684733bf84e7796704b49502 
*tests/data/fate/iamf-9_1_6.iamf
 #codec_id 9: flac
 #sample_rate 9: 44100
 #channel_layout_name 9: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-2,          0,          0,     4096,     1323, 0xb9bc0f9a
-3,          0,          0,     4096,     1323, 0xb9bc0f9a
-4,          0,          0,     4096,     1323, 0xb9bc0f9a
-5,          0,          0,     4096,     1323, 0xb9bc0f9a
-6,          0,          0,     4096,     1323, 0xb9bc0f9a
-7,          0,          0,     4096,     1320, 0x45220e92
-8,          0,          0,     4096,     1320, 0x45220e92
-9,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-2,       4096,       4096,     4096,     1254, 0xf7e910bc
-3,       4096,       4096,     4096,     1254, 0xf7e910bc
-4,       4096,       4096,     4096,     1254, 0xf7e910bc
-5,       4096,       4096,     4096,     1254, 0xf7e910bc
-6,       4096,       4096,     4096,     1254, 0xf7e910bc
-7,       4096,       4096,     4096,     1251, 0x70521040
-8,       4096,       4096,     4096,     1251, 0x70521040
-9,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-2,       8192,       8192,     4096,     1320, 0xe4fe09c9
-3,       8192,       8192,     4096,     1320, 0xe4fe09c9
-4,       8192,       8192,     4096,     1320, 0xe4fe09c9
-5,       8192,       8192,     4096,     1320, 0xe4fe09c9
-6,       8192,       8192,     4096,     1320, 0xe4fe09c9
-7,       8192,       8192,     4096,     1317, 0x6c5408ea
-8,       8192,       8192,     4096,     1317, 0x6c5408ea
-9,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-2,      12288,      12288,     4096,     1280, 0x22e9127e
-3,      12288,      12288,     4096,     1280, 0x22e9127e
-4,      12288,      12288,     4096,     1280, 0x22e9127e
-5,      12288,      12288,     4096,     1280, 0x22e9127e
-6,      12288,      12288,     4096,     1280, 0x22e9127e
-7,      12288,      12288,     4096,     1277, 0xa6e11330
-8,      12288,      12288,     4096,     1277, 0xa6e11330
-9,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-2,      16384,      16384,     4096,     1331, 0x8bc61bbf
-3,      16384,      16384,     4096,     1331, 0x8bc61bbf
-4,      16384,      16384,     4096,     1331, 0x8bc61bbf
-5,      16384,      16384,     4096,     1331, 0x8bc61bbf
-6,      16384,      16384,     4096,     1331, 0x8bc61bbf
-7,      16384,      16384,     4096,     1328, 0x21371b83
-8,      16384,      16384,     4096,     1328, 0x21371b83
-9,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-2,      20480,      20480,     4096,     1267, 0x2c4708fa
-3,      20480,      20480,     4096,     1267, 0x2c4708fa
-4,      20480,      20480,     4096,     1267, 0x2c4708fa
-5,      20480,      20480,     4096,     1267, 0x2c4708fa
-6,      20480,      20480,     4096,     1267, 0x2c4708fa
-7,      20480,      20480,     4096,     1264, 0x4358080b
-8,      20480,      20480,     4096,     1264, 0x4358080b
-9,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-1,      24576,      24576,     4096,     1282, 0x0438152d
-2,      24576,      24576,     4096,     1282, 0x0438152d
-3,      24576,      24576,     4096,     1282, 0x0438152d
-4,      24576,      24576,     4096,     1282, 0x0438152d
-5,      24576,      24576,     4096,     1282, 0x0438152d
-6,      24576,      24576,     4096,     1282, 0x0438152d
-7,      24576,      24576,     4096,     1279, 0xf63b158e
-8,      24576,      24576,     4096,     1279, 0xf63b158e
-9,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-2,      28672,      28672,     4096,     1313, 0x2e79ffa2
-3,      28672,      28672,     4096,     1313, 0x2e79ffa2
-4,      28672,      28672,     4096,     1313, 0x2e79ffa2
-5,      28672,      28672,     4096,     1313, 0x2e79ffa2
-6,      28672,      28672,     4096,     1313, 0x2e79ffa2
-7,      28672,      28672,     4096,     1310, 0x1f77ff91
-8,      28672,      28672,     4096,     1310, 0x1f77ff91
-9,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-2,      32768,      32768,     4096,     1323, 0xb9f70fce
-3,      32768,      32768,     4096,     1323, 0xb9f70fce
-4,      32768,      32768,     4096,     1323, 0xb9f70fce
-5,      32768,      32768,     4096,     1323, 0xb9f70fce
-6,      32768,      32768,     4096,     1323, 0xb9f70fce
-7,      32768,      32768,     4096,     1320, 0xea180f1a
-8,      32768,      32768,     4096,     1320, 0xea180f1a
-9,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-2,      36864,      36864,     4096,     1254, 0xf6f01051
-3,      36864,      36864,     4096,     1254, 0xf6f01051
-4,      36864,      36864,     4096,     1254, 0xf6f01051
-5,      36864,      36864,     4096,     1254, 0xf6f01051
-6,      36864,      36864,     4096,     1254, 0xf6f01051
-7,      36864,      36864,     4096,     1251, 0x0b380fcb
-8,      36864,      36864,     4096,     1251, 0x0b380fcb
-9,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-4,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-5,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-6,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-7,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-8,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-9,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+1,          0,          0,     4608,     1399, 0x6e89566e
+2,          0,          0,     4608,     1399, 0x6e89566e
+3,          0,          0,     4608,     1399, 0x6e89566e
+4,          0,          0,     4608,     1399, 0x6e89566e
+5,          0,          0,     4608,     1399, 0x6e89566e
+6,          0,          0,     4608,     1399, 0x6e89566e
+7,          0,          0,     4608,     1396, 0x0dcb5677
+8,          0,          0,     4608,     1396, 0x0dcb5677
+9,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+2,       4608,       4608,     4608,     1442, 0x6c3c5b13
+3,       4608,       4608,     4608,     1442, 0x6c3c5b13
+4,       4608,       4608,     4608,     1442, 0x6c3c5b13
+5,       4608,       4608,     4608,     1442, 0x6c3c5b13
+6,       4608,       4608,     4608,     1442, 0x6c3c5b13
+7,       4608,       4608,     4608,     1439, 0xc46b5ac5
+8,       4608,       4608,     4608,     1439, 0xc46b5ac5
+9,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+1,       9216,       9216,     4608,     1380, 0xc497571b
+2,       9216,       9216,     4608,     1380, 0xc497571b
+3,       9216,       9216,     4608,     1380, 0xc497571b
+4,       9216,       9216,     4608,     1380, 0xc497571b
+5,       9216,       9216,     4608,     1380, 0xc497571b
+6,       9216,       9216,     4608,     1380, 0xc497571b
+7,       9216,       9216,     4608,     1377, 0x5b2a55fe
+8,       9216,       9216,     4608,     1377, 0x5b2a55fe
+9,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+2,      13824,      13824,     4608,     1383, 0x48e9510f
+3,      13824,      13824,     4608,     1383, 0x48e9510f
+4,      13824,      13824,     4608,     1383, 0x48e9510f
+5,      13824,      13824,     4608,     1383, 0x48e9510f
+6,      13824,      13824,     4608,     1383, 0x48e9510f
+7,      13824,      13824,     4608,     1380, 0x045550d3
+8,      13824,      13824,     4608,     1380, 0x045550d3
+9,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+1,      18432,      18432,     4608,     1572, 0x9a514719
+2,      18432,      18432,     4608,     1572, 0x9a514719
+3,      18432,      18432,     4608,     1572, 0x9a514719
+4,      18432,      18432,     4608,     1572, 0x9a514719
+5,      18432,      18432,     4608,     1572, 0x9a514719
+6,      18432,      18432,     4608,     1572, 0x9a514719
+7,      18432,      18432,     4608,     1568, 0xa2bc45f4
+8,      18432,      18432,     4608,     1568, 0xa2bc45f4
+9,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+2,      23040,      23040,     4608,     1391, 0x74ac5014
+3,      23040,      23040,     4608,     1391, 0x74ac5014
+4,      23040,      23040,     4608,     1391, 0x74ac5014
+5,      23040,      23040,     4608,     1391, 0x74ac5014
+6,      23040,      23040,     4608,     1391, 0x74ac5014
+7,      23040,      23040,     4608,     1388, 0x96c85007
+8,      23040,      23040,     4608,     1388, 0x96c85007
+9,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+2,      27648,      27648,     4608,     1422, 0x2f9d47c5
+3,      27648,      27648,     4608,     1422, 0x2f9d47c5
+4,      27648,      27648,     4608,     1422, 0x2f9d47c5
+5,      27648,      27648,     4608,     1422, 0x2f9d47c5
+6,      27648,      27648,     4608,     1422, 0x2f9d47c5
+7,      27648,      27648,     4608,     1419, 0x4d4d466a
+8,      27648,      27648,     4608,     1419, 0x4d4d466a
+9,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+2,      32256,      32256,     4608,     1768, 0x2a044b99
+3,      32256,      32256,     4608,     1768, 0x2a044b99
+4,      32256,      32256,     4608,     1768, 0x2a044b99
+5,      32256,      32256,     4608,     1768, 0x2a044b99
+6,      32256,      32256,     4608,     1768, 0x2a044b99
+7,      32256,      32256,     4608,     1765, 0xacb84b24
+8,      32256,      32256,     4608,     1765, 0xacb84b24
+9,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+2,      36864,      36864,     4608,     1534, 0xb0b35a3f
+3,      36864,      36864,     4608,     1534, 0xb0b35a3f
+4,      36864,      36864,     4608,     1534, 0xb0b35a3f
+5,      36864,      36864,     4608,     1534, 0xb0b35a3f
+6,      36864,      36864,     4608,     1534, 0xb0b35a3f
+7,      36864,      36864,     4608,     1531, 0x996458aa
+8,      36864,      36864,     4608,     1531, 0x996458aa
+9,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+4,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+5,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+6,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+7,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+8,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+9,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/iamf-ambisonic_1 b/tests/ref/fate/iamf-ambisonic_1
index 318383bbff9..c0d6ad6e968 100644
--- a/tests/ref/fate/iamf-ambisonic_1
+++ b/tests/ref/fate/iamf-ambisonic_1
@@ -1,9 +1,9 @@
-080a07d57dba74ffe9e238832ec7338a *tests/data/fate/iamf-ambisonic_1.iamf
-56878 tests/data/fate/iamf-ambisonic_1.iamf
-#extradata 0:       34, 0x9f9f0c6b
-#extradata 1:       34, 0x9f9f0c6b
-#extradata 2:       34, 0x9f9f0c6b
-#extradata 3:       34, 0x9f9f0c6b
+1dc2c8eb5476b56b3bd5b77e09fab303 *tests/data/fate/iamf-ambisonic_1.iamf
+62482 tests/data/fate/iamf-ambisonic_1.iamf
+#extradata 0:       34, 0x99880c8b
+#extradata 1:       34, 0x99880c8b
+#extradata 2:       34, 0x99880c8b
+#extradata 3:       34, 0x99880c8b
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -24,50 +24,46 @@
 #codec_id 3: flac
 #sample_rate 3: 44100
 #channel_layout_name 3: mono
-0,          0,          0,     4096,     1320, 0x45220e92
-1,          0,          0,     4096,     1320, 0x45220e92
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-0,       4096,       4096,     4096,     1251, 0x70521040
-1,       4096,       4096,     4096,     1251, 0x70521040
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-0,       8192,       8192,     4096,     1317, 0x6c5408ea
-1,       8192,       8192,     4096,     1317, 0x6c5408ea
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-0,      12288,      12288,     4096,     1277, 0xa6e11330
-1,      12288,      12288,     4096,     1277, 0xa6e11330
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-0,      16384,      16384,     4096,     1328, 0x21371b83
-1,      16384,      16384,     4096,     1328, 0x21371b83
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-0,      20480,      20480,     4096,     1264, 0x4358080b
-1,      20480,      20480,     4096,     1264, 0x4358080b
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-0,      24576,      24576,     4096,     1279, 0xf63b158e
-1,      24576,      24576,     4096,     1279, 0xf63b158e
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-0,      28672,      28672,     4096,     1310, 0x1f77ff91
-1,      28672,      28672,     4096,     1310, 0x1f77ff91
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-0,      32768,      32768,     4096,     1320, 0xea180f1a
-1,      32768,      32768,     4096,     1320, 0xea180f1a
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-0,      36864,      36864,     4096,     1251, 0x0b380fcb
-1,      36864,      36864,     4096,     1251, 0x0b380fcb
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-0,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1396, 0x0dcb5677
+1,          0,          0,     4608,     1396, 0x0dcb5677
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+0,       4608,       4608,     4608,     1439, 0xc46b5ac5
+1,       4608,       4608,     4608,     1439, 0xc46b5ac5
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+0,       9216,       9216,     4608,     1377, 0x5b2a55fe
+1,       9216,       9216,     4608,     1377, 0x5b2a55fe
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+0,      13824,      13824,     4608,     1380, 0x045550d3
+1,      13824,      13824,     4608,     1380, 0x045550d3
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+0,      18432,      18432,     4608,     1568, 0xa2bc45f4
+1,      18432,      18432,     4608,     1568, 0xa2bc45f4
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+0,      23040,      23040,     4608,     1388, 0x96c85007
+1,      23040,      23040,     4608,     1388, 0x96c85007
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+0,      27648,      27648,     4608,     1419, 0x4d4d466a
+1,      27648,      27648,     4608,     1419, 0x4d4d466a
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+0,      32256,      32256,     4608,     1765, 0xacb84b24
+1,      32256,      32256,     4608,     1765, 0xacb84b24
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+0,      36864,      36864,     4608,     1531, 0x996458aa
+1,      36864,      36864,     4608,     1531, 0x996458aa
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+0,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/iamf-ambisonic_1-projection 
b/tests/ref/fate/iamf-ambisonic_1-projection
index ab8fbb3b66b..7ec958ac32b 100644
--- a/tests/ref/fate/iamf-ambisonic_1-projection
+++ b/tests/ref/fate/iamf-ambisonic_1-projection
@@ -1,9 +1,9 @@
-ed03b6fda77f5bdb1f5da78fcec6ee46 
*tests/data/fate/iamf-ambisonic_1-projection.iamf
-56907 tests/data/fate/iamf-ambisonic_1-projection.iamf
-#extradata 0:       34, 0x9f9f0c6b
-#extradata 1:       34, 0x9f9f0c6b
-#extradata 2:       34, 0x9f9f0c6b
-#extradata 3:       34, 0x9f9f0c6b
+fac5be4ab7af9803547eff77789ea117 
*tests/data/fate/iamf-ambisonic_1-projection.iamf
+62511 tests/data/fate/iamf-ambisonic_1-projection.iamf
+#extradata 0:       34, 0x99880c8b
+#extradata 1:       34, 0x99880c8b
+#extradata 2:       34, 0x99880c8b
+#extradata 3:       34, 0x99880c8b
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -24,50 +24,46 @@ ed03b6fda77f5bdb1f5da78fcec6ee46 
*tests/data/fate/iamf-ambisonic_1-projection.ia
 #codec_id 3: flac
 #sample_rate 3: 44100
 #channel_layout_name 3: mono
-0,          0,          0,     4096,     1320, 0x45220e92
-1,          0,          0,     4096,     1320, 0x45220e92
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-0,       4096,       4096,     4096,     1251, 0x70521040
-1,       4096,       4096,     4096,     1251, 0x70521040
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-0,       8192,       8192,     4096,     1317, 0x6c5408ea
-1,       8192,       8192,     4096,     1317, 0x6c5408ea
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-0,      12288,      12288,     4096,     1277, 0xa6e11330
-1,      12288,      12288,     4096,     1277, 0xa6e11330
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-0,      16384,      16384,     4096,     1328, 0x21371b83
-1,      16384,      16384,     4096,     1328, 0x21371b83
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-0,      20480,      20480,     4096,     1264, 0x4358080b
-1,      20480,      20480,     4096,     1264, 0x4358080b
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-0,      24576,      24576,     4096,     1279, 0xf63b158e
-1,      24576,      24576,     4096,     1279, 0xf63b158e
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-0,      28672,      28672,     4096,     1310, 0x1f77ff91
-1,      28672,      28672,     4096,     1310, 0x1f77ff91
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-0,      32768,      32768,     4096,     1320, 0xea180f1a
-1,      32768,      32768,     4096,     1320, 0xea180f1a
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-0,      36864,      36864,     4096,     1251, 0x0b380fcb
-1,      36864,      36864,     4096,     1251, 0x0b380fcb
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-0,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1396, 0x0dcb5677
+1,          0,          0,     4608,     1396, 0x0dcb5677
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+0,       4608,       4608,     4608,     1439, 0xc46b5ac5
+1,       4608,       4608,     4608,     1439, 0xc46b5ac5
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+0,       9216,       9216,     4608,     1377, 0x5b2a55fe
+1,       9216,       9216,     4608,     1377, 0x5b2a55fe
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+0,      13824,      13824,     4608,     1380, 0x045550d3
+1,      13824,      13824,     4608,     1380, 0x045550d3
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+0,      18432,      18432,     4608,     1568, 0xa2bc45f4
+1,      18432,      18432,     4608,     1568, 0xa2bc45f4
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+0,      23040,      23040,     4608,     1388, 0x96c85007
+1,      23040,      23040,     4608,     1388, 0x96c85007
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+0,      27648,      27648,     4608,     1419, 0x4d4d466a
+1,      27648,      27648,     4608,     1419, 0x4d4d466a
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+0,      32256,      32256,     4608,     1765, 0xacb84b24
+1,      32256,      32256,     4608,     1765, 0xacb84b24
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+0,      36864,      36864,     4608,     1531, 0x996458aa
+1,      36864,      36864,     4608,     1531, 0x996458aa
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+0,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/iamf-stereo b/tests/ref/fate/iamf-stereo
index 659835cbc43..67c3ace4096 100644
--- a/tests/ref/fate/iamf-stereo
+++ b/tests/ref/fate/iamf-stereo
@@ -1,22 +1,21 @@
-76a2b09ad6366df642be576129322f36 *tests/data/fate/iamf-stereo.iamf
-14397 tests/data/fate/iamf-stereo.iamf
-#extradata 0:       34, 0xa77c0cd6
+bc2a52173fa33247ef187b7bdd3270a4 *tests/data/fate/iamf-stereo.iamf
+15795 tests/data/fate/iamf-stereo.iamf
+#extradata 0:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
 #sample_rate 0: 44100
 #channel_layout_name 0: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/matroska-flac-extradata-update 
b/tests/ref/fate/matroska-flac-extradata-update
index 7b03cd83223..0fde578e8e5 100644
--- a/tests/ref/fate/matroska-flac-extradata-update
+++ b/tests/ref/fate/matroska-flac-extradata-update
@@ -1,8 +1,8 @@
-d2a3d0d94119043c3293b86bc137be94 
*tests/data/fate/matroska-flac-extradata-update.matroska
-1956 tests/data/fate/matroska-flac-extradata-update.matroska
-#extradata 0:       34, 0x7166090c
-#extradata 1:       34, 0x7166090c
-#extradata 2:       34, 0x7166090c
+b4f511c63b66f7beda5d2f1d99d91f38 
*tests/data/fate/matroska-flac-extradata-update.matroska
+1957 tests/data/fate/matroska-flac-extradata-update.matroska
+#extradata 0:       34, 0x93650c81
+#extradata 1:       34, 0x93650c81
+#extradata 2:       34, 0x93650c81
 #tb 0: 1/100000
 #media_type 0: audio
 #codec_id 0: flac
@@ -18,27 +18,27 @@ d2a3d0d94119043c3293b86bc137be94 
*tests/data/fate/matroska-flac-extradata-update
 #codec_id 2: flac
 #sample_rate 2: 48000
 #channel_layout_name 2: 5.1
-0,          0,          0,     8533,       26, 0x50f80431
-1,          0,          0,     8533,       26, 0x50f80431
-2,          0,          0,     8533,       26, 0x50f80431
-0,       8533,       8533,     8533,       26, 0x50d30416
-1,       8533,       8533,     8533,       26, 0x50d30416
-2,       8533,       8533,     8533,       26, 0x50d30416
-0,      17065,      17065,     8533,       26, 0x51ee046f
-1,      17065,      17065,     8533,       26, 0x51ee046f
-2,      17065,      17065,     8533,       26, 0x51ee046f
-0,      25598,      25598,     8533,       26, 0x521d0458
-1,      25598,      25598,     8533,       26, 0x521d0458
-2,      25598,      25598,     8533,       26, 0x521d0458
-0,      34133,      34133,     8533,       26, 0x531c043d
-1,      34133,      34133,     8533,       26, 0x531c043d
-2,      34133,      34133,     8533,       26, 0x531c043d
-0,      42667,      42667,     8533,       26, 0x53cf0442
-1,      42667,      42667,     8533,       26, 0x53cf0442
-2,      42667,      42667,     8533,       26, 0x53cf0442
-0,      51198,      51198,     8533,       26, 0x536a0473
-1,      51198,      51198,     8533,       26, 0x536a0473
-2,      51198,      51198,     8533,       26, 0x536a0473
-0,      59731,      59731,     8533,       26, 0x5321046c
-1,      59731,      59731,     8533,       26, 0x5321046c
-2,      59731,      59731,     8533,       26, 0x5321046c
+0,          0,          0,     9600,       26, 0x4e160341
+1,          0,          0,     9600,       26, 0x4e160341
+2,          0,          0,     9600,       26, 0x4e160341
+0,       9600,       9600,     9600,       26, 0x4e17035c
+1,       9600,       9600,     9600,       26, 0x4e17035c
+2,       9600,       9600,     9600,       26, 0x4e17035c
+0,      19198,      19198,     9600,       26, 0x4de40383
+1,      19198,      19198,     9600,       26, 0x4de40383
+2,      19198,      19198,     9600,       26, 0x4de40383
+0,      28798,      28798,     9600,       26, 0x4e3903a2
+1,      28798,      28798,     9600,       26, 0x4e3903a2
+2,      28798,      28798,     9600,       26, 0x4e3903a2
+0,      38400,      38400,     9600,       26, 0x4f9a03d5
+1,      38400,      38400,     9600,       26, 0x4f9a03d5
+2,      38400,      38400,     9600,       26, 0x4f9a03d5
+0,      48000,      48000,     9600,       26, 0x501303e0
+1,      48000,      48000,     9600,       26, 0x501303e0
+2,      48000,      48000,     9600,       26, 0x501303e0
+0,      57598,      57598,     9600,       26, 0x5160042f
+1,      57598,      57598,     9600,       26, 0x5160042f
+2,      57598,      57598,     9600,       26, 0x5160042f
+0,      67198,      67198,     9600,       26, 0x50dd042e
+1,      67198,      67198,     9600,       26, 0x50dd042e
+2,      67198,      67198,     9600,       26, 0x50dd042e
diff --git a/tests/ref/fate/mov-mp4-iamf-5_1_4 
b/tests/ref/fate/mov-mp4-iamf-5_1_4
index 2f12d416c25..9c9504b8f71 100644
--- a/tests/ref/fate/mov-mp4-iamf-5_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-5_1_4
@@ -1,11 +1,11 @@
-8e716b0da4d680223653e672b4ece910 *tests/data/fate/mov-mp4-iamf-5_1_4.mp4
-86156 tests/data/fate/mov-mp4-iamf-5_1_4.mp4
-#extradata 0:       34, 0xa77c0cd6
-#extradata 1:       34, 0xa77c0cd6
-#extradata 2:       34, 0xa7500cd4
-#extradata 3:       34, 0xa7500cd4
-#extradata 4:       34, 0xa77c0cd6
-#extradata 5:       34, 0xa77c0cd6
+4d7ce55fd4dcf81ba429c2c13ce5bda5 *tests/data/fate/mov-mp4-iamf-5_1_4.mp4
+94546 tests/data/fate/mov-mp4-iamf-5_1_4.mp4
+#extradata 0:       34, 0x90430a91
+#extradata 1:       34, 0x90430a91
+#extradata 2:       34, 0x90170a8f
+#extradata 3:       34, 0x90170a8f
+#extradata 4:       34, 0x90430a91
+#extradata 5:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -36,72 +36,66 @@
 #codec_id 5: flac
 #sample_rate 5: 44100
 #channel_layout_name 5: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-4,          0,          0,     4096,     1323, 0xb9bc0f9a
-5,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-4,       4096,       4096,     4096,     1254, 0xf7e910bc
-5,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-4,       8192,       8192,     4096,     1320, 0xe4fe09c9
-5,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-4,      12288,      12288,     4096,     1280, 0x22e9127e
-5,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-4,      16384,      16384,     4096,     1331, 0x8bc61bbf
-5,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-4,      20480,      20480,     4096,     1267, 0x2c4708fa
-5,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-1,      24576,      24576,     4096,     1282, 0x0438152d
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-4,      24576,      24576,     4096,     1282, 0x0438152d
-5,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-4,      28672,      28672,     4096,     1313, 0x2e79ffa2
-5,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-4,      32768,      32768,     4096,     1323, 0xb9f70fce
-5,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-4,      36864,      36864,     4096,     1254, 0xf6f01051
-5,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-4,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-5,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+1,          0,          0,     4608,     1399, 0x6e89566e
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+4,          0,          0,     4608,     1399, 0x6e89566e
+5,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+4,       4608,       4608,     4608,     1442, 0x6c3c5b13
+5,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+1,       9216,       9216,     4608,     1380, 0xc497571b
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+4,       9216,       9216,     4608,     1380, 0xc497571b
+5,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+4,      13824,      13824,     4608,     1383, 0x48e9510f
+5,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+1,      18432,      18432,     4608,     1572, 0x9a514719
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+4,      18432,      18432,     4608,     1572, 0x9a514719
+5,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+4,      23040,      23040,     4608,     1391, 0x74ac5014
+5,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+4,      27648,      27648,     4608,     1422, 0x2f9d47c5
+5,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+4,      32256,      32256,     4608,     1768, 0x2a044b99
+5,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+4,      36864,      36864,     4608,     1534, 0xb0b35a3f
+5,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+4,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+5,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
@@ -137,10 +131,10 @@ nb_subblocks=1
 type=1
 parameter_id=998
 parameter_rate=44100
-duration=4096
-constant_subblock_duration=4096
+duration=4608
+constant_subblock_duration=4608
 [PIECE]
-subblock_duration=4096
+subblock_duration=4608
 dmixp_mode=1
 [/PIECE]
 [/SUBCOMPONENT]
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first 
b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first
index 8154e09e193..24b78dcf79c 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first
@@ -1,11 +1,11 @@
 #extradata 0:       30, 0x47ab0576
-#extradata 1:       34, 0xa77c0cd6
-#extradata 2:       34, 0xa77c0cd6
-#extradata 3:       34, 0xa7500cd4
-#extradata 4:       34, 0xa7500cd4
-#extradata 5:       34, 0xa77c0cd6
-#extradata 6:       34, 0xa77c0cd6
-#extradata 7:       34, 0xa77c0cd6
+#extradata 1:       34, 0x90430a91
+#extradata 2:       34, 0x90430a91
+#extradata 3:       34, 0x90170a8f
+#extradata 4:       34, 0x90170a8f
+#extradata 5:       34, 0x90430a91
+#extradata 6:       34, 0x90430a91
+#extradata 7:       34, 0x90430a91
 #tb 0: 1/12800
 #media_type 0: video
 #codec_id 0: mpeg4
@@ -47,106 +47,99 @@
 #sample_rate 7: 44100
 #channel_layout_name 7: stereo
 0,          0,          0,      512,    42002, 0xef0e5124
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-2,          0,          0,     4096,     1323, 0xb9bc0f9a
-3,          0,          0,     4096,     1320, 0x45220e92
-4,          0,          0,     4096,     1320, 0x45220e92
-5,          0,          0,     4096,     1323, 0xb9bc0f9a
-6,          0,          0,     4096,     1323, 0xb9bc0f9a
-7,          0,          0,     4096,     1323, 0xb9bc0f9a
+1,          0,          0,     4608,     1399, 0x6e89566e
+2,          0,          0,     4608,     1399, 0x6e89566e
+3,          0,          0,     4608,     1396, 0x0dcb5677
+4,          0,          0,     4608,     1396, 0x0dcb5677
+5,          0,          0,     4608,     1399, 0x6e89566e
+6,          0,          0,     4608,     1399, 0x6e89566e
+7,          0,          0,     4608,     1399, 0x6e89566e
 0,        512,        512,      512,    52619, 0xc794e830, F=0x0
 0,       1024,       1024,      512,    51242, 0xf2f6be7f, F=0x0
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-2,       4096,       4096,     4096,     1254, 0xf7e910bc
-3,       4096,       4096,     4096,     1251, 0x70521040
-4,       4096,       4096,     4096,     1251, 0x70521040
-5,       4096,       4096,     4096,     1254, 0xf7e910bc
-6,       4096,       4096,     4096,     1254, 0xf7e910bc
-7,       4096,       4096,     4096,     1254, 0xf7e910bc
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+2,       4608,       4608,     4608,     1442, 0x6c3c5b13
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+4,       4608,       4608,     4608,     1439, 0xc46b5ac5
+5,       4608,       4608,     4608,     1442, 0x6c3c5b13
+6,       4608,       4608,     4608,     1442, 0x6c3c5b13
+7,       4608,       4608,     4608,     1442, 0x6c3c5b13
 0,       1536,       1536,      512,    49320, 0xe87a921f, F=0x0
 0,       2048,       2048,      512,    22461, 0xc858a20b, F=0x0
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-2,       8192,       8192,     4096,     1320, 0xe4fe09c9
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-4,       8192,       8192,     4096,     1317, 0x6c5408ea
-5,       8192,       8192,     4096,     1320, 0xe4fe09c9
-6,       8192,       8192,     4096,     1320, 0xe4fe09c9
-7,       8192,       8192,     4096,     1320, 0xe4fe09c9
 0,       2560,       2560,      512,    16731, 0x04beb863, F=0x0
+1,       9216,       9216,     4608,     1380, 0xc497571b
+2,       9216,       9216,     4608,     1380, 0xc497571b
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+4,       9216,       9216,     4608,     1377, 0x5b2a55fe
+5,       9216,       9216,     4608,     1380, 0xc497571b
+6,       9216,       9216,     4608,     1380, 0xc497571b
+7,       9216,       9216,     4608,     1380, 0xc497571b
 0,       3072,       3072,      512,     9983, 0x091aa8e8, F=0x0
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-2,      12288,      12288,     4096,     1280, 0x22e9127e
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-4,      12288,      12288,     4096,     1277, 0xa6e11330
-5,      12288,      12288,     4096,     1280, 0x22e9127e
-6,      12288,      12288,     4096,     1280, 0x22e9127e
-7,      12288,      12288,     4096,     1280, 0x22e9127e
 0,       3584,       3584,      512,     6991, 0xa0385313, F=0x0
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+2,      13824,      13824,     4608,     1383, 0x48e9510f
+3,      13824,      13824,     4608,     1380, 0x045550d3
+4,      13824,      13824,     4608,     1380, 0x045550d3
+5,      13824,      13824,     4608,     1383, 0x48e9510f
+6,      13824,      13824,     4608,     1383, 0x48e9510f
+7,      13824,      13824,     4608,     1383, 0x48e9510f
 0,       4096,       4096,      512,     5825, 0x3c97cfbc, F=0x0
 0,       4608,       4608,      512,     4331, 0xbaf5f982, F=0x0
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-2,      16384,      16384,     4096,     1331, 0x8bc61bbf
-3,      16384,      16384,     4096,     1328, 0x21371b83
-4,      16384,      16384,     4096,     1328, 0x21371b83
-5,      16384,      16384,     4096,     1331, 0x8bc61bbf
-6,      16384,      16384,     4096,     1331, 0x8bc61bbf
-7,      16384,      16384,     4096,     1331, 0x8bc61bbf
 0,       5120,       5120,      512,     2541, 0xe018c3cb, F=0x0
+1,      18432,      18432,     4608,     1572, 0x9a514719
+2,      18432,      18432,     4608,     1572, 0x9a514719
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+4,      18432,      18432,     4608,     1568, 0xa2bc45f4
+5,      18432,      18432,     4608,     1572, 0x9a514719
+6,      18432,      18432,     4608,     1572, 0x9a514719
+7,      18432,      18432,     4608,     1572, 0x9a514719
 0,       5632,       5632,      512,     2655, 0xf98af7a1, F=0x0
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-2,      20480,      20480,     4096,     1267, 0x2c4708fa
-3,      20480,      20480,     4096,     1264, 0x4358080b
-4,      20480,      20480,     4096,     1264, 0x4358080b
-5,      20480,      20480,     4096,     1267, 0x2c4708fa
-6,      20480,      20480,     4096,     1267, 0x2c4708fa
-7,      20480,      20480,     4096,     1267, 0x2c4708fa
 0,       6144,       6144,      512,    13464, 0x33e5196f
 0,       6656,       6656,      512,     2587, 0x90e198aa, F=0x0
-1,      24576,      24576,     4096,     1282, 0x0438152d
-2,      24576,      24576,     4096,     1282, 0x0438152d
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-4,      24576,      24576,     4096,     1279, 0xf63b158e
-5,      24576,      24576,     4096,     1282, 0x0438152d
-6,      24576,      24576,     4096,     1282, 0x0438152d
-7,      24576,      24576,     4096,     1282, 0x0438152d
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+2,      23040,      23040,     4608,     1391, 0x74ac5014
+3,      23040,      23040,     4608,     1388, 0x96c85007
+4,      23040,      23040,     4608,     1388, 0x96c85007
+5,      23040,      23040,     4608,     1391, 0x74ac5014
+6,      23040,      23040,     4608,     1391, 0x74ac5014
+7,      23040,      23040,     4608,     1391, 0x74ac5014
 0,       7168,       7168,      512,     2313, 0x698c429b, F=0x0
 0,       7680,       7680,      512,     2123, 0x63a3f034, F=0x0
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+2,      27648,      27648,     4608,     1422, 0x2f9d47c5
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+4,      27648,      27648,     4608,     1419, 0x4d4d466a
+5,      27648,      27648,     4608,     1422, 0x2f9d47c5
+6,      27648,      27648,     4608,     1422, 0x2f9d47c5
+7,      27648,      27648,     4608,     1422, 0x2f9d47c5
 0,       8192,       8192,      512,     2222, 0x442b233d, F=0x0
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-2,      28672,      28672,     4096,     1313, 0x2e79ffa2
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-4,      28672,      28672,     4096,     1310, 0x1f77ff91
-5,      28672,      28672,     4096,     1313, 0x2e79ffa2
-6,      28672,      28672,     4096,     1313, 0x2e79ffa2
-7,      28672,      28672,     4096,     1313, 0x2e79ffa2
 0,       8704,       8704,      512,     2332, 0x24c75b04, F=0x0
 0,       9216,       9216,      512,     2302, 0xa0fa2ee7, F=0x0
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-2,      32768,      32768,     4096,     1323, 0xb9f70fce
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-4,      32768,      32768,     4096,     1320, 0xea180f1a
-5,      32768,      32768,     4096,     1323, 0xb9f70fce
-6,      32768,      32768,     4096,     1323, 0xb9f70fce
-7,      32768,      32768,     4096,     1323, 0xb9f70fce
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+2,      32256,      32256,     4608,     1768, 0x2a044b99
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+4,      32256,      32256,     4608,     1765, 0xacb84b24
+5,      32256,      32256,     4608,     1768, 0x2a044b99
+6,      32256,      32256,     4608,     1768, 0x2a044b99
+7,      32256,      32256,     4608,     1768, 0x2a044b99
 0,       9728,       9728,      512,     1740, 0xdf772eb3, F=0x0
 0,      10240,      10240,      512,     1994, 0x8830ad23, F=0x0
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-2,      36864,      36864,     4096,     1254, 0xf6f01051
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-4,      36864,      36864,     4096,     1251, 0x0b380fcb
-5,      36864,      36864,     4096,     1254, 0xf6f01051
-6,      36864,      36864,     4096,     1254, 0xf6f01051
-7,      36864,      36864,     4096,     1254, 0xf6f01051
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+2,      36864,      36864,     4608,     1534, 0xb0b35a3f
+3,      36864,      36864,     4608,     1531, 0x996458aa
+4,      36864,      36864,     4608,     1531, 0x996458aa
+5,      36864,      36864,     4608,     1534, 0xb0b35a3f
+6,      36864,      36864,     4608,     1534, 0xb0b35a3f
+7,      36864,      36864,     4608,     1534, 0xb0b35a3f
 0,      10752,      10752,      512,     1884, 0x2c567db6, F=0x0
 0,      11264,      11264,      512,     1880, 0x72237c52, F=0x0
 0,      11776,      11776,      512,     1970, 0x60708ff8, F=0x0
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-4,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-5,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-6,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-7,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+4,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+5,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+6,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+7,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 0,      12288,      12288,      512,    11659, 0x6bcb830e
 [STREAM_GROUP]
 index=0
@@ -183,10 +176,10 @@ nb_subblocks=1
 type=1
 parameter_id=998
 parameter_rate=44100
-duration=4096
-constant_subblock_duration=4096
+duration=4608
+constant_subblock_duration=4608
 [PIECE]
-subblock_duration=4096
+subblock_duration=4608
 dmixp_mode=1
 [/PIECE]
 [/SUBCOMPONENT]
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-2 
b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-2
index 2cca39ef85b..f6c2012bbbf 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-2
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-2
@@ -1,17 +1,16 @@
-#extradata 0:       34, 0xa77c0cd6
+#extradata 0:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
 #sample_rate 0: 44100
 #channel_layout_name 0: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-3 
b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-3
index 49130fe1e3f..97d3ffa9d57 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-3
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first-3
@@ -1,17 +1,16 @@
-#extradata 0:       34, 0xa7500cd4
+#extradata 0:       34, 0x90170a8f
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
 #sample_rate 0: 44100
 #channel_layout_name 0: mono
-0,          0,          0,     4096,     1320, 0x45220e92
-0,       4096,       4096,     4096,     1251, 0x70521040
-0,       8192,       8192,     4096,     1317, 0x6c5408ea
-0,      12288,      12288,     4096,     1277, 0xa6e11330
-0,      16384,      16384,     4096,     1328, 0x21371b83
-0,      20480,      20480,     4096,     1264, 0x4358080b
-0,      24576,      24576,     4096,     1279, 0xf63b158e
-0,      28672,      28672,     4096,     1310, 0x1f77ff91
-0,      32768,      32768,     4096,     1320, 0xea180f1a
-0,      36864,      36864,     4096,     1251, 0x0b380fcb
-0,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1396, 0x0dcb5677
+0,       4608,       4608,     4608,     1439, 0xc46b5ac5
+0,       9216,       9216,     4608,     1377, 0x5b2a55fe
+0,      13824,      13824,     4608,     1380, 0x045550d3
+0,      18432,      18432,     4608,     1568, 0xa2bc45f4
+0,      23040,      23040,     4608,     1388, 0x96c85007
+0,      27648,      27648,     4608,     1419, 0x4d4d466a
+0,      32256,      32256,     4608,     1765, 0xacb84b24
+0,      36864,      36864,     4608,     1531, 0x996458aa
+0,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last 
b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last
index fa80c841035..77f05b3c68c 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last
@@ -1,12 +1,12 @@
-1148d7f77ced5b57262e689e841eff77 
*tests/data/fate/mov-mp4-iamf-7_1_4-video-last.mp4
-416424 tests/data/fate/mov-mp4-iamf-7_1_4-video-last.mp4
-#extradata 0:       34, 0xa77c0cd6
-#extradata 1:       34, 0xa77c0cd6
-#extradata 2:       34, 0xa7500cd4
-#extradata 3:       34, 0xa7500cd4
-#extradata 4:       34, 0xa77c0cd6
-#extradata 5:       34, 0xa77c0cd6
-#extradata 6:       34, 0xa77c0cd6
+0e462d2cf789042488af40d6c64d61ee 
*tests/data/fate/mov-mp4-iamf-7_1_4-video-last.mp4
+426204 tests/data/fate/mov-mp4-iamf-7_1_4-video-last.mp4
+#extradata 0:       34, 0x90430a91
+#extradata 1:       34, 0x90430a91
+#extradata 2:       34, 0x90170a8f
+#extradata 3:       34, 0x90170a8f
+#extradata 4:       34, 0x90430a91
+#extradata 5:       34, 0x90430a91
+#extradata 6:       34, 0x90430a91
 #extradata 7:       30, 0x47ab0576
 #tb 0: 1/44100
 #media_type 0: audio
@@ -48,107 +48,100 @@
 #codec_id 7: mpeg4
 #dimensions 7: 352x288
 #sar 7: 1/1
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-4,          0,          0,     4096,     1323, 0xb9bc0f9a
-5,          0,          0,     4096,     1323, 0xb9bc0f9a
-6,          0,          0,     4096,     1323, 0xb9bc0f9a
+0,          0,          0,     4608,     1399, 0x6e89566e
+1,          0,          0,     4608,     1399, 0x6e89566e
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+4,          0,          0,     4608,     1399, 0x6e89566e
+5,          0,          0,     4608,     1399, 0x6e89566e
+6,          0,          0,     4608,     1399, 0x6e89566e
 7,          0,          0,      512,    42002, 0xef0e5124
 7,        512,        512,      512,    52619, 0xc794e830, F=0x0
 7,       1024,       1024,      512,    51242, 0xf2f6be7f, F=0x0
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-4,       4096,       4096,     4096,     1254, 0xf7e910bc
-5,       4096,       4096,     4096,     1254, 0xf7e910bc
-6,       4096,       4096,     4096,     1254, 0xf7e910bc
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+4,       4608,       4608,     4608,     1442, 0x6c3c5b13
+5,       4608,       4608,     4608,     1442, 0x6c3c5b13
+6,       4608,       4608,     4608,     1442, 0x6c3c5b13
 7,       1536,       1536,      512,    49320, 0xe87a921f, F=0x0
 7,       2048,       2048,      512,    22461, 0xc858a20b, F=0x0
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-4,       8192,       8192,     4096,     1320, 0xe4fe09c9
-5,       8192,       8192,     4096,     1320, 0xe4fe09c9
-6,       8192,       8192,     4096,     1320, 0xe4fe09c9
 7,       2560,       2560,      512,    16731, 0x04beb863, F=0x0
+0,       9216,       9216,     4608,     1380, 0xc497571b
+1,       9216,       9216,     4608,     1380, 0xc497571b
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+4,       9216,       9216,     4608,     1380, 0xc497571b
+5,       9216,       9216,     4608,     1380, 0xc497571b
+6,       9216,       9216,     4608,     1380, 0xc497571b
 7,       3072,       3072,      512,     9983, 0x091aa8e8, F=0x0
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-4,      12288,      12288,     4096,     1280, 0x22e9127e
-5,      12288,      12288,     4096,     1280, 0x22e9127e
-6,      12288,      12288,     4096,     1280, 0x22e9127e
 7,       3584,       3584,      512,     6991, 0xa0385313, F=0x0
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+4,      13824,      13824,     4608,     1383, 0x48e9510f
+5,      13824,      13824,     4608,     1383, 0x48e9510f
+6,      13824,      13824,     4608,     1383, 0x48e9510f
 7,       4096,       4096,      512,     5825, 0x3c97cfbc, F=0x0
 7,       4608,       4608,      512,     4331, 0xbaf5f982, F=0x0
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-4,      16384,      16384,     4096,     1331, 0x8bc61bbf
-5,      16384,      16384,     4096,     1331, 0x8bc61bbf
-6,      16384,      16384,     4096,     1331, 0x8bc61bbf
 7,       5120,       5120,      512,     2541, 0xe018c3cb, F=0x0
+0,      18432,      18432,     4608,     1572, 0x9a514719
+1,      18432,      18432,     4608,     1572, 0x9a514719
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+4,      18432,      18432,     4608,     1572, 0x9a514719
+5,      18432,      18432,     4608,     1572, 0x9a514719
+6,      18432,      18432,     4608,     1572, 0x9a514719
 7,       5632,       5632,      512,     2655, 0xf98af7a1, F=0x0
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-4,      20480,      20480,     4096,     1267, 0x2c4708fa
-5,      20480,      20480,     4096,     1267, 0x2c4708fa
-6,      20480,      20480,     4096,     1267, 0x2c4708fa
 7,       6144,       6144,      512,    13464, 0x33e5196f
 7,       6656,       6656,      512,     2587, 0x90e198aa, F=0x0
-0,      24576,      24576,     4096,     1282, 0x0438152d
-1,      24576,      24576,     4096,     1282, 0x0438152d
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-4,      24576,      24576,     4096,     1282, 0x0438152d
-5,      24576,      24576,     4096,     1282, 0x0438152d
-6,      24576,      24576,     4096,     1282, 0x0438152d
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+4,      23040,      23040,     4608,     1391, 0x74ac5014
+5,      23040,      23040,     4608,     1391, 0x74ac5014
+6,      23040,      23040,     4608,     1391, 0x74ac5014
 7,       7168,       7168,      512,     2313, 0x698c429b, F=0x0
 7,       7680,       7680,      512,     2123, 0x63a3f034, F=0x0
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+4,      27648,      27648,     4608,     1422, 0x2f9d47c5
+5,      27648,      27648,     4608,     1422, 0x2f9d47c5
+6,      27648,      27648,     4608,     1422, 0x2f9d47c5
 7,       8192,       8192,      512,     2222, 0x442b233d, F=0x0
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-4,      28672,      28672,     4096,     1313, 0x2e79ffa2
-5,      28672,      28672,     4096,     1313, 0x2e79ffa2
-6,      28672,      28672,     4096,     1313, 0x2e79ffa2
 7,       8704,       8704,      512,     2332, 0x24c75b04, F=0x0
 7,       9216,       9216,      512,     2302, 0xa0fa2ee7, F=0x0
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-4,      32768,      32768,     4096,     1323, 0xb9f70fce
-5,      32768,      32768,     4096,     1323, 0xb9f70fce
-6,      32768,      32768,     4096,     1323, 0xb9f70fce
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+4,      32256,      32256,     4608,     1768, 0x2a044b99
+5,      32256,      32256,     4608,     1768, 0x2a044b99
+6,      32256,      32256,     4608,     1768, 0x2a044b99
 7,       9728,       9728,      512,     1740, 0xdf772eb3, F=0x0
 7,      10240,      10240,      512,     1994, 0x8830ad23, F=0x0
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-4,      36864,      36864,     4096,     1254, 0xf6f01051
-5,      36864,      36864,     4096,     1254, 0xf6f01051
-6,      36864,      36864,     4096,     1254, 0xf6f01051
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+4,      36864,      36864,     4608,     1534, 0xb0b35a3f
+5,      36864,      36864,     4608,     1534, 0xb0b35a3f
+6,      36864,      36864,     4608,     1534, 0xb0b35a3f
 7,      10752,      10752,      512,     1884, 0x2c567db6, F=0x0
 7,      11264,      11264,      512,     1880, 0x72237c52, F=0x0
 7,      11776,      11776,      512,     1970, 0x60708ff8, F=0x0
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-4,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-5,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-6,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+4,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+5,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+6,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 7,      12288,      12288,      512,    11659, 0x6bcb830e
 [STREAM_GROUP]
 index=0
@@ -185,10 +178,10 @@ nb_subblocks=1
 type=1
 parameter_id=998
 parameter_rate=44100
-duration=4096
-constant_subblock_duration=4096
+duration=4608
+constant_subblock_duration=4608
 [PIECE]
-subblock_duration=4096
+subblock_duration=4608
 dmixp_mode=1
 [/PIECE]
 [/SUBCOMPONENT]
diff --git a/tests/ref/fate/mov-mp4-iamf-ambisonic_1 
b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
index cfd03c0cac4..4af18aee2fc 100644
--- a/tests/ref/fate/mov-mp4-iamf-ambisonic_1
+++ b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
@@ -1,9 +1,9 @@
-055fee0d65af7d634591dd7c382db256 *tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
-57611 tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
-#extradata 0:       34, 0x9f9f0c6b
-#extradata 1:       34, 0x9f9f0c6b
-#extradata 2:       34, 0x9f9f0c6b
-#extradata 3:       34, 0x9f9f0c6b
+2e52da50d421140ff85a5d8a2610b4e8 *tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
+63211 tests/data/fate/mov-mp4-iamf-ambisonic_1.mp4
+#extradata 0:       34, 0x99880c8b
+#extradata 1:       34, 0x99880c8b
+#extradata 2:       34, 0x99880c8b
+#extradata 3:       34, 0x99880c8b
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -24,50 +24,46 @@
 #codec_id 3: flac
 #sample_rate 3: 44100
 #channel_layout_name 3: mono
-0,          0,          0,     4096,     1320, 0x45220e92
-1,          0,          0,     4096,     1320, 0x45220e92
-2,          0,          0,     4096,     1320, 0x45220e92
-3,          0,          0,     4096,     1320, 0x45220e92
-0,       4096,       4096,     4096,     1251, 0x70521040
-1,       4096,       4096,     4096,     1251, 0x70521040
-2,       4096,       4096,     4096,     1251, 0x70521040
-3,       4096,       4096,     4096,     1251, 0x70521040
-0,       8192,       8192,     4096,     1317, 0x6c5408ea
-1,       8192,       8192,     4096,     1317, 0x6c5408ea
-2,       8192,       8192,     4096,     1317, 0x6c5408ea
-3,       8192,       8192,     4096,     1317, 0x6c5408ea
-0,      12288,      12288,     4096,     1277, 0xa6e11330
-1,      12288,      12288,     4096,     1277, 0xa6e11330
-2,      12288,      12288,     4096,     1277, 0xa6e11330
-3,      12288,      12288,     4096,     1277, 0xa6e11330
-0,      16384,      16384,     4096,     1328, 0x21371b83
-1,      16384,      16384,     4096,     1328, 0x21371b83
-2,      16384,      16384,     4096,     1328, 0x21371b83
-3,      16384,      16384,     4096,     1328, 0x21371b83
-0,      20480,      20480,     4096,     1264, 0x4358080b
-1,      20480,      20480,     4096,     1264, 0x4358080b
-2,      20480,      20480,     4096,     1264, 0x4358080b
-3,      20480,      20480,     4096,     1264, 0x4358080b
-0,      24576,      24576,     4096,     1279, 0xf63b158e
-1,      24576,      24576,     4096,     1279, 0xf63b158e
-2,      24576,      24576,     4096,     1279, 0xf63b158e
-3,      24576,      24576,     4096,     1279, 0xf63b158e
-0,      28672,      28672,     4096,     1310, 0x1f77ff91
-1,      28672,      28672,     4096,     1310, 0x1f77ff91
-2,      28672,      28672,     4096,     1310, 0x1f77ff91
-3,      28672,      28672,     4096,     1310, 0x1f77ff91
-0,      32768,      32768,     4096,     1320, 0xea180f1a
-1,      32768,      32768,     4096,     1320, 0xea180f1a
-2,      32768,      32768,     4096,     1320, 0xea180f1a
-3,      32768,      32768,     4096,     1320, 0xea180f1a
-0,      36864,      36864,     4096,     1251, 0x0b380fcb
-1,      36864,      36864,     4096,     1251, 0x0b380fcb
-2,      36864,      36864,     4096,     1251, 0x0b380fcb
-3,      36864,      36864,     4096,     1251, 0x0b380fcb
-0,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-2,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
-3,      40960,      40960,     4096,     1231, 0x98611f9f, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1396, 0x0dcb5677
+1,          0,          0,     4608,     1396, 0x0dcb5677
+2,          0,          0,     4608,     1396, 0x0dcb5677
+3,          0,          0,     4608,     1396, 0x0dcb5677
+0,       4608,       4608,     4608,     1439, 0xc46b5ac5
+1,       4608,       4608,     4608,     1439, 0xc46b5ac5
+2,       4608,       4608,     4608,     1439, 0xc46b5ac5
+3,       4608,       4608,     4608,     1439, 0xc46b5ac5
+0,       9216,       9216,     4608,     1377, 0x5b2a55fe
+1,       9216,       9216,     4608,     1377, 0x5b2a55fe
+2,       9216,       9216,     4608,     1377, 0x5b2a55fe
+3,       9216,       9216,     4608,     1377, 0x5b2a55fe
+0,      13824,      13824,     4608,     1380, 0x045550d3
+1,      13824,      13824,     4608,     1380, 0x045550d3
+2,      13824,      13824,     4608,     1380, 0x045550d3
+3,      13824,      13824,     4608,     1380, 0x045550d3
+0,      18432,      18432,     4608,     1568, 0xa2bc45f4
+1,      18432,      18432,     4608,     1568, 0xa2bc45f4
+2,      18432,      18432,     4608,     1568, 0xa2bc45f4
+3,      18432,      18432,     4608,     1568, 0xa2bc45f4
+0,      23040,      23040,     4608,     1388, 0x96c85007
+1,      23040,      23040,     4608,     1388, 0x96c85007
+2,      23040,      23040,     4608,     1388, 0x96c85007
+3,      23040,      23040,     4608,     1388, 0x96c85007
+0,      27648,      27648,     4608,     1419, 0x4d4d466a
+1,      27648,      27648,     4608,     1419, 0x4d4d466a
+2,      27648,      27648,     4608,     1419, 0x4d4d466a
+3,      27648,      27648,     4608,     1419, 0x4d4d466a
+0,      32256,      32256,     4608,     1765, 0xacb84b24
+1,      32256,      32256,     4608,     1765, 0xacb84b24
+2,      32256,      32256,     4608,     1765, 0xacb84b24
+3,      32256,      32256,     4608,     1765, 0xacb84b24
+0,      36864,      36864,     4608,     1531, 0x996458aa
+1,      36864,      36864,     4608,     1531, 0x996458aa
+2,      36864,      36864,     4608,     1531, 0x996458aa
+3,      36864,      36864,     4608,     1531, 0x996458aa
+0,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+2,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
+3,      41472,      41472,     4608,     2289, 0x80cbf593, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/mov-mp4-iamf-stereo 
b/tests/ref/fate/mov-mp4-iamf-stereo
index 0121d4cefbc..f07b1aa8328 100644
--- a/tests/ref/fate/mov-mp4-iamf-stereo
+++ b/tests/ref/fate/mov-mp4-iamf-stereo
@@ -1,22 +1,21 @@
-d268398dd4374413f9b26d540ea99182 *tests/data/fate/mov-mp4-iamf-stereo.mp4
-15130 tests/data/fate/mov-mp4-iamf-stereo.mp4
-#extradata 0:       34, 0xa77c0cd6
+a3ab06b05841f2dccd90f6a99c6ae39a *tests/data/fate/mov-mp4-iamf-stereo.mp4
+16524 tests/data/fate/mov-mp4-iamf-stereo.mp4
+#extradata 0:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
 #sample_rate 0: 44100
 #channel_layout_name 0: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/mov-mp4-iamf-stereo-id-collision 
b/tests/ref/fate/mov-mp4-iamf-stereo-id-collision
index 29c07a933c9..0c0bfe3d1a8 100644
--- a/tests/ref/fate/mov-mp4-iamf-stereo-id-collision
+++ b/tests/ref/fate/mov-mp4-iamf-stereo-id-collision
@@ -1,7 +1,7 @@
-8a3f028128f356a389f27a592d32a18d 
*tests/data/fate/mov-mp4-iamf-stereo-id-collision.mp4
-29290 tests/data/fate/mov-mp4-iamf-stereo-id-collision.mp4
-#extradata 0:       34, 0xa77c0cd6
-#extradata 1:       34, 0xa77c0cd6
+b260df50ed05a3d40d5331f2859ba550 
*tests/data/fate/mov-mp4-iamf-stereo-id-collision.mp4
+32082 tests/data/fate/mov-mp4-iamf-stereo-id-collision.mp4
+#extradata 0:       34, 0x90430a91
+#extradata 1:       34, 0x90430a91
 #tb 0: 1/44100
 #media_type 0: audio
 #codec_id 0: flac
@@ -12,28 +12,26 @@
 #codec_id 1: flac
 #sample_rate 1: 44100
 #channel_layout_name 1: stereo
-0,          0,          0,     4096,     1323, 0xb9bc0f9a
-1,          0,          0,     4096,     1323, 0xb9bc0f9a
-0,       4096,       4096,     4096,     1254, 0xf7e910bc
-1,       4096,       4096,     4096,     1254, 0xf7e910bc
-0,       8192,       8192,     4096,     1320, 0xe4fe09c9
-1,       8192,       8192,     4096,     1320, 0xe4fe09c9
-0,      12288,      12288,     4096,     1280, 0x22e9127e
-1,      12288,      12288,     4096,     1280, 0x22e9127e
-0,      16384,      16384,     4096,     1331, 0x8bc61bbf
-1,      16384,      16384,     4096,     1331, 0x8bc61bbf
-0,      20480,      20480,     4096,     1267, 0x2c4708fa
-1,      20480,      20480,     4096,     1267, 0x2c4708fa
-0,      24576,      24576,     4096,     1282, 0x0438152d
-1,      24576,      24576,     4096,     1282, 0x0438152d
-0,      28672,      28672,     4096,     1313, 0x2e79ffa2
-1,      28672,      28672,     4096,     1313, 0x2e79ffa2
-0,      32768,      32768,     4096,     1323, 0xb9f70fce
-1,      32768,      32768,     4096,     1323, 0xb9f70fce
-0,      36864,      36864,     4096,     1254, 0xf6f01051
-1,      36864,      36864,     4096,     1254, 0xf6f01051
-0,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
-1,      40960,      40960,     4096,     1235, 0xcf181f77, S=1, Skip Samples,  
     10, 0x047700bf
+0,          0,          0,     4608,     1399, 0x6e89566e
+1,          0,          0,     4608,     1399, 0x6e89566e
+0,       4608,       4608,     4608,     1442, 0x6c3c5b13
+1,       4608,       4608,     4608,     1442, 0x6c3c5b13
+0,       9216,       9216,     4608,     1380, 0xc497571b
+1,       9216,       9216,     4608,     1380, 0xc497571b
+0,      13824,      13824,     4608,     1383, 0x48e9510f
+1,      13824,      13824,     4608,     1383, 0x48e9510f
+0,      18432,      18432,     4608,     1572, 0x9a514719
+1,      18432,      18432,     4608,     1572, 0x9a514719
+0,      23040,      23040,     4608,     1391, 0x74ac5014
+1,      23040,      23040,     4608,     1391, 0x74ac5014
+0,      27648,      27648,     4608,     1422, 0x2f9d47c5
+1,      27648,      27648,     4608,     1422, 0x2f9d47c5
+0,      32256,      32256,     4608,     1768, 0x2a044b99
+1,      32256,      32256,     4608,     1768, 0x2a044b99
+0,      36864,      36864,     4608,     1534, 0xb0b35a3f
+1,      36864,      36864,     4608,     1534, 0xb0b35a3f
+0,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
+1,      41472,      41472,     4608,     2292, 0x0e4cf69d, S=1, Skip Samples,  
     10, 0x048b00c3
 [STREAM_GROUP]
 index=0
 id=0x1
diff --git a/tests/ref/fate/mov-reenc-delete-stream-metadata 
b/tests/ref/fate/mov-reenc-delete-stream-metadata
index dd8bccc4f00..fb4c815e004 100644
--- a/tests/ref/fate/mov-reenc-delete-stream-metadata
+++ b/tests/ref/fate/mov-reenc-delete-stream-metadata
@@ -1,5 +1,5 @@
-5e44edd89f2f43665ff5e4e53638fdf5 
*tests/data/fate/mov-reenc-delete-stream-metadata.nut
-6605 tests/data/fate/mov-reenc-delete-stream-metadata.nut
+3aeffaf59390c7add44111b3e7f88625 
*tests/data/fate/mov-reenc-delete-stream-metadata.nut
+7559 tests/data/fate/mov-reenc-delete-stream-metadata.nut
 [STREAM]
 TAG:encoder=Lavc flac
 TAG:creation_time=2002-06-02T18:38:54.000000Z
diff --git a/tests/ref/fate/mov-reenc-delete-stream-metadata-global-tag 
b/tests/ref/fate/mov-reenc-delete-stream-metadata-global-tag
index 424bfa2d96a..09c22e86805 100644
--- a/tests/ref/fate/mov-reenc-delete-stream-metadata-global-tag
+++ b/tests/ref/fate/mov-reenc-delete-stream-metadata-global-tag
@@ -1,5 +1,5 @@
-dc4bc94edbf9bcf78cf74471f244398b 
*tests/data/fate/mov-reenc-delete-stream-metadata-global-tag.nut
-6623 tests/data/fate/mov-reenc-delete-stream-metadata-global-tag.nut
+2c79ec38ef1ba7fc75187d543debc8b7 
*tests/data/fate/mov-reenc-delete-stream-metadata-global-tag.nut
+7577 tests/data/fate/mov-reenc-delete-stream-metadata-global-tag.nut
 [STREAM]
 TAG:encoder=Lavc flac
 TAG:creation_time=2002-06-02T18:38:54.000000Z
diff --git a/tests/ref/fate/ogg-flac-chained-bps 
b/tests/ref/fate/ogg-flac-chained-bps
index 84b16132a83..67ddf87d516 100644
--- a/tests/ref/fate/ogg-flac-chained-bps
+++ b/tests/ref/fate/ogg-flac-chained-bps
@@ -3,47 +3,13 @@
 #codec_id 0: pcm_s32le
 #sample_rate 0: 44100
 #channel_layout_name 0: mono
-0,          0,          0,     1024,     4096, 0x4c38f45b
-0,       1024,       1024,     1024,     4096, 0x4b0cf6ec
-0,       2048,       2048,     1024,     4096, 0x59c4fe05
-0,       3072,       3072,     1024,     4096, 0x8b7006b5
-0,       4096,       4096,     1024,     4096, 0x6799fcca
-0,       5120,       5120,     1024,     4096, 0x1753f510
-0,       6144,       6144,     1024,     4096, 0xaf7ef717
-0,       7168,       7168,     1024,     4096, 0x8d0a0826
-0,       8192,       8192,     1024,     4096, 0xe4520954
-0,       9216,       9216,     1024,     4096, 0x7c69f55c
-0,      10240,      10240,     1024,     4096, 0x1db1f7ee
-0,      11264,      11264,     1024,     4096, 0xf6e4fe99
-0,      12288,      12288,     1024,     4096, 0x2a8c0191
-0,      13312,      13312,     1024,     4096, 0x05940797
-0,      14336,      14336,     1024,     4096, 0xabadf38b
-0,      15360,      15360,     1024,     4096, 0x6a0af701
-0,      16384,      16384,     1024,     4096, 0xf0fe0476
-0,      17408,      17408,     1024,     4096, 0xb3ec0222
-0,      18432,      18432,     1024,     4096, 0x27c0013e
-0,      19456,      19456,     1024,     4096, 0x3b94f0eb
-0,      20480,      20480,     1024,     4096, 0x3973fada
-0,      21504,      21504,      546,     2184, 0x7e55340b
-0,      22050,      22050,     1024,     4096, 0x22f2f151
-0,      23074,      23074,     1024,     4096, 0x7736f949
-0,      24098,      24098,     1024,     4096, 0x24480657
-0,      25122,      25122,     1024,     4096, 0xfc05f763
-0,      26146,      26146,     1024,     4096, 0x4b8eff25
-0,      27170,      27170,     1024,     4096, 0x21510055
-0,      28194,      28194,     1024,     4096, 0x1ee7f371
-0,      29218,      29218,     1024,     4096, 0x11f0fd28
-0,      30242,      30242,     1024,     4096, 0xf7c60713
-0,      31266,      31266,     1024,     4096, 0x4853fa2d
-0,      32290,      32290,     1024,     4096, 0x6a78f34f
-0,      33314,      33314,     1024,     4096, 0x54ae03b7
-0,      34338,      34338,     1024,     4096, 0x4c11fc94
-0,      35362,      35362,     1024,     4096, 0xf16bf999
-0,      36386,      36386,     1024,     4096, 0xad13042e
-0,      37410,      37410,     1024,     4096, 0xfa29f592
-0,      38434,      38434,     1024,     4096, 0x3885f74a
-0,      39458,      39458,     1024,     4096, 0x3c0a094a
-0,      40482,      40482,     1024,     4096, 0xe169fd1c
-0,      41506,      41506,     1024,     4096, 0x18aaf19a
-0,      42530,      42530,     1024,     4096, 0xc892ffaa
-0,      43554,      43554,      546,     2184, 0xc3e22e2f
+0,          0,          0,     4608,    18432, 0x092cf656
+0,       4608,       4608,     4608,    18432, 0x32f5f452
+0,       9216,       9216,     4608,    18432, 0x35eeef05
+0,      13824,      13824,     4608,    18432, 0xd63ff757
+0,      18432,      18432,     3618,    14472, 0x677d212c
+0,      22050,      22050,     4608,    18432, 0x75b5e982
+0,      26658,      26658,     4608,    18432, 0xd710f634
+0,      31266,      31266,     4608,    18432, 0x49beed20
+0,      35874,      35874,     4608,    18432, 0x8df9f4d0
+0,      40482,      40482,     3618,    14472, 0x7e121cbc
diff --git a/tests/ref/lavf/wv b/tests/ref/lavf/wv
index 3b0c1547619..07205093f3c 100644
--- a/tests/ref/lavf/wv
+++ b/tests/ref/lavf/wv
@@ -1,3 +1,3 @@
-bb085606d40a45530826269fbbcfaa8e *tests/data/lavf/lavf.wv
-61078 tests/data/lavf/lavf.wv
+47d9a381d9c3f99b8b059f3b17f1dc11 *tests/data/lavf/lavf.wv
+59560 tests/data/lavf/lavf.wv
 tests/data/lavf/lavf.wv CRC=0x3a1da17e
diff --git a/tests/ref/seek/acodec-flac b/tests/ref/seek/acodec-flac
index 9f6ea765b06..f6add9abd2b 100644
--- a/tests/ref/seek/acodec-flac
+++ b/tests/ref/seek/acodec-flac
@@ -1,53 +1,53 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.857596 pts: 1.857596 pos:  84066 size:  
7758
+ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos:  86742 size:  
2191
 ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.835918 pts: 0.835918 pos:  27528 size:  
2149
+ret: 0         st: 0 flags:1 dts: 0.809796 pts: 0.809796 pos:  27366 size:   
615
 ret: 0         st: 0 flags:1  ts:-0.317506
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.600635 pts: 2.600635 pos: 145926 size:  
8455
+ret: 0         st: 0 flags:1 dts: 2.586122 pts: 2.586122 pos: 145606 size:  
2384
 ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.393197 pts: 1.393197 pos:  48089 size:  
6342
+ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos:  53388 size:  
1851
 ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:  16824 size:  
2139
+ret: 0         st: 0 flags:1 dts: 0.365714 pts: 0.365714 pos:  16890 size:   
614
 ret: 0         st: 0 flags:1  ts:-0.740839
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.229116 pts: 2.229116 pos: 114661 size:  
7572
+ret: 0         st: 0 flags:1 dts: 2.168163 pts: 2.168163 pos: 110531 size:  
2143
 ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.021678 pts: 1.021678 pos:  31960 size:  
2135
+ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos:  32880 size:   
579
 ret: 0         st: 0 flags:0  ts:-0.058322
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.786395 pts: 2.786395 pos: 162845 size:  
8470
+ret: 0         st: 0 flags:1 dts: 2.821224 pts: 2.821224 pos: 167112 size:  
2391
 ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.764717 pts: 1.764717 pos:  76312 size:  
7754
+ret: 0         st: 0 flags:1 dts: 1.750204 pts: 1.750204 pos:  75788 size:  
2191
 ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.557279 pts: 0.557279 pos:  21106 size:  
2149
+ret: 0         st: 0 flags:1 dts: 0.600816 pts: 0.600816 pos:  22446 size:   
616
 ret: 0         st: 0 flags:0  ts:-0.481655
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.321995 pts: 2.321995 pos: 122233 size:  
7569
+ret: 0         st: 0 flags:1 dts: 2.403265 pts: 2.403265 pos: 129793 size:  
2138
 ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.393197 pts: 1.393197 pos:  48089 size:  
6342
+ret: 0         st: 0 flags:1 dts: 1.332245 pts: 1.332245 pos:  44812 size:  
1609
 ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:  12542 size:  
2143
+ret: 0         st: 0 flags:1 dts: 0.182857 pts: 0.182857 pos:  12572 size:   
628
 ret: 0         st: 0 flags:0  ts:-0.904989
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.950476 pts: 1.950476 pos:  91824 size:  
7672
+ret: 0         st: 0 flags:1 dts: 1.985306 pts: 1.985306 pos:  95508 size:  
2169
 ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.928798 pts: 0.928798 pos:  29677 size:  
2283
+ret: 0         st: 0 flags:1 dts: 0.888163 pts: 0.888163 pos:  29211 size:   
620
 ret: 0         st:-1 flags:1  ts:-0.222493
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
 ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos: 154381 size:  
8464
+ret: 0         st: 0 flags:1 dts: 2.690612 pts: 2.690612 pos: 155154 size:  
2394
 ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.486077 pts: 1.486077 pos:  54431 size:  
6874
+ret: 0         st: 0 flags:1 dts: 1.541224 pts: 1.541224 pos:  59082 size:  
1974
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos:  18963 size:  
2143
+ret: 0         st: 0 flags:1 dts: 0.470204 pts: 0.470204 pos:  19353 size:   
608
 ret: 0         st:-1 flags:1  ts:-0.645825
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:  
2137
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   8256 size:   
614
-- 
2.54.1


>From 4496218b02549f3106f0dc491718f46dcec3ebf7 Mon Sep 17 00:00:00 2001
From: Jun Zhao <[email protected]>
Date: Sat, 21 Nov 2026 18:07:59 +0800
Subject: [PATCH 2/4] tests/fate: cover FLAC block size with small input frames

Verify that encoding 40-sample input frames to FLAC uses the encoder's
own 4608-sample block size rather than inheriting the input frame size.

Signed-off-by: Jun Zhao <[email protected]>
---
 tests/fate/acodec.mak                   | 3 +++
 tests/ref/fate/audio-enc-flac-blocksize | 8 ++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 tests/ref/fate/audio-enc-flac-blocksize

diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
index 0669c705b50..fa201ff40a2 100644
--- a/tests/fate/acodec.mak
+++ b/tests/fate/acodec.mak
@@ -201,5 +201,8 @@ fate-audio-enc-roq-early-flush: CMD = framecrc -f lavfi -i 
sine=r=22050 -af atri
 FATE_AUDIO_ENCODER_BOUNDARY-$(call ALLYES, $(AUDIO_ENCODER_BOUNDARY_DEPS) 
ADPCM_MS_ENCODER) += fate-audio-enc-adpcm-ms-mono-trellis
 fate-audio-enc-adpcm-ms-mono-trellis: CMD = framecrc -f lavfi -i sine=r=44100 
-af atrim=end_sample=2036 -c:a adpcm_ms -trellis 5
 
+FATE_AUDIO_ENCODER_BOUNDARY-$(call ALLYES, $(AUDIO_ENCODER_BOUNDARY_DEPS) 
FLAC_ENCODER ASETNSAMPLES_FILTER) += fate-audio-enc-flac-blocksize
+fate-audio-enc-flac-blocksize: CMD = framecrc -f lavfi -i sine=r=48000 -af 
atrim=end_sample=4608,asetnsamples=n=40:p=0 -c:a flac -lpc_type fixed
+
 FATE_FFMPEG += $(FATE_AUDIO_ENCODER_BOUNDARY-yes)
 fate-acodec fate-audio-encoder-boundary: $(FATE_AUDIO_ENCODER_BOUNDARY-yes)
diff --git a/tests/ref/fate/audio-enc-flac-blocksize 
b/tests/ref/fate/audio-enc-flac-blocksize
new file mode 100644
index 00000000000..e7ded2353a4
--- /dev/null
+++ b/tests/ref/fate/audio-enc-flac-blocksize
@@ -0,0 +1,8 @@
+#extradata 0:       34, 0x2f990210
+#tb 0: 1/48000
+#media_type 0: audio
+#codec_id 0: flac
+#sample_rate 0: 48000
+#channel_layout_name 0: mono
+0,          0,          0,     4608,     1831, 0x152547ce
+0,       4608,       4608,        0,        0, 0x00000000, S=1, New Extradata, 
      34, 0x80360ae8
-- 
2.54.1


>From b00f9b6006f94309ace53a3990cb6affd6eaf3b0 Mon Sep 17 00:00:00 2001
From: Jun Zhao <[email protected]>
Date: Sat, 21 Nov 2026 18:07:59 +0800
Subject: [PATCH 3/4] fftools/ffmpeg_mux_init: account for user fixed-size
 audio requests

setup_sync_queues() only checked codec capabilities and Encoder.flags2
when deciding whether an audio stream needs an encoding sync queue,
missing user -flags2 +fixed_frame_size (regressed in 7d905abec6) and
-frame_size (regressed in b1120b1ed8) options applied to enc_ctx in
ost_add(). With AV_CODEC_CAP_VARIABLE_FRAME_SIZE encoders, enc_open()
then returned a nonzero frame size with no sync queue, triggering an
assert abort in ffmpeg_sched.c.

Also check enc_ctx->frame_size and enc_ctx->flags2 to match enc_open().

Signed-off-by: Jun Zhao <[email protected]>
---
 fftools/ffmpeg_mux_init.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 00d33bb03bf..524aae1732e 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -2228,9 +2228,19 @@ static int setup_sync_queues(Muxer *mux, AVFormatContext 
*oc,
 
         nb_interleaved += IS_INTERLEAVED(type);
         nb_av_enc      += IS_AV_ENC(ost, type);
-        nb_audio_fs    += (ost->enc && type == AVMEDIA_TYPE_AUDIO &&
-                           (!(ost->enc->enc_ctx->codec->capabilities & 
AV_CODEC_CAP_VARIABLE_FRAME_SIZE) ||
-                            (ost->enc->flags2 & 
AV_CODEC_FLAG2_FIXED_FRAME_SIZE)));
+        if (ost->enc && type == AVMEDIA_TYPE_AUDIO) {
+            const AVCodecContext *enc_ctx = ost->enc->enc_ctx;
+
+            /* enc_open() reports an audio frame size whenever the encoder uses
+             * fixed-size frames, which requires a sync queue to be set up 
here.
+             * Besides codec caps and the muxer-requested flag (stored in
+             * Encoder.flags2), user -flags2/-frame_size options have already
+             * been applied to enc_ctx by ost_add() at this point. */
+            nb_audio_fs += !(enc_ctx->codec->capabilities & 
AV_CODEC_CAP_VARIABLE_FRAME_SIZE) ||
+                           enc_ctx->frame_size > 0 ||
+                           ((ost->enc->flags2 | enc_ctx->flags2) &
+                            AV_CODEC_FLAG2_FIXED_FRAME_SIZE);
+        }
 
         limit_frames        |=  ms->max_frames < INT64_MAX;
         limit_frames_av_enc |= (ms->max_frames < INT64_MAX) && IS_AV_ENC(ost, 
type);
-- 
2.54.1


>From ce70d0faec96024740804ca4383203e81465cad1 Mon Sep 17 00:00:00 2001
From: Jun Zhao <[email protected]>
Date: Sat, 21 Nov 2026 18:07:59 +0800
Subject: [PATCH 4/4] tests/fate: cover user fixed-size requests on
 variable-size encoders

Add fate-ffmpeg-fixed-frame-size and fate-ffmpeg-user-frame-size to test
-flags2 +fixed_frame_size and -frame_size on pcm_s16le, verifying fixed
1024-sample framing and tail padding without aborting in the scheduler.

Signed-off-by: Jun Zhao <[email protected]>
---
 tests/fate/ffmpeg.mak                  | 10 ++++++++++
 tests/ref/fate/ffmpeg-fixed-frame-size |  8 ++++++++
 tests/ref/fate/ffmpeg-user-frame-size  |  8 ++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 tests/ref/fate/ffmpeg-fixed-frame-size
 create mode 100644 tests/ref/fate/ffmpeg-user-frame-size

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index e665b08bb9a..127f6656a7b 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -5,6 +5,16 @@ fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex 
color=d=1:r=5 -fflags
 FATE_FFMPEG-$(call FILTERFRAMECRC, AEVALSRC ASETNSAMPLES ARESAMPLE, 
AC3_FIXED_ENCODER) += fate-ffmpeg-filter_complex_audio
 fate-ffmpeg-filter_complex_audio: CMD = framecrc -auto_conversion_filters 
-filter_complex "aevalsrc=0:d=0.1,asetnsamples=1537" -c ac3_fixed
 
+# -flags2 +fixed_frame_size and -frame_size on a variable-frame-size encoder
+# must get an encoding sync queue rather than aborting in the scheduler.
+FATE_FFMPEG-$(call ALLYES, LAVFI_INDEV SINE_FILTER ATRIM_FILTER 
ASETNSAMPLES_FILTER \
+                           PCM_S16LE_DECODER PCM_S16LE_ENCODER FRAMECRC_MUXER 
PIPE_PROTOCOL) \
+    += fate-ffmpeg-fixed-frame-size fate-ffmpeg-user-frame-size
+fate-ffmpeg-fixed-frame-size: CMD = framecrc -f lavfi -i sine=r=48000 \
+    -af atrim=end_sample=2500,asetnsamples=n=1024:p=0 -c:a pcm_s16le -flags2 
+fixed_frame_size
+fate-ffmpeg-user-frame-size: CMD = framecrc -f lavfi -i sine=r=48000 \
+    -af atrim=end_sample=2500,asetnsamples=n=40:p=0 -c:a pcm_s16le -frame_size 
1024
+
 # Ticket 6375, use case of NoX
 FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MOV, PNG ALAC, ARESAMPLE_FILTER) += 
fate-ffmpeg-attached_pics
 fate-ffmpeg-attached_pics: CMD = threads=2 framecrc -i 
$(TARGET_SAMPLES)/lossless-audio/inside.m4a -threads 1 -max_muxing_queue_size 
16 -af aresample
diff --git a/tests/ref/fate/ffmpeg-fixed-frame-size 
b/tests/ref/fate/ffmpeg-fixed-frame-size
new file mode 100644
index 00000000000..fd3108a28fb
--- /dev/null
+++ b/tests/ref/fate/ffmpeg-fixed-frame-size
@@ -0,0 +1,8 @@
+#tb 0: 1/48000
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 48000
+#channel_layout_name 0: mono
+0,          0,          0,     1024,     2048, 0x0ae4e6ab
+0,       1024,       1024,     1024,     2048, 0xbcaffeb7
+0,       2048,       2048,      452,     2048, 0xf1d3c78d, S=1, Skip Samples,  
     10, 0x0172003e
diff --git a/tests/ref/fate/ffmpeg-user-frame-size 
b/tests/ref/fate/ffmpeg-user-frame-size
new file mode 100644
index 00000000000..fd3108a28fb
--- /dev/null
+++ b/tests/ref/fate/ffmpeg-user-frame-size
@@ -0,0 +1,8 @@
+#tb 0: 1/48000
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 48000
+#channel_layout_name 0: mono
+0,          0,          0,     1024,     2048, 0x0ae4e6ab
+0,       1024,       1024,     1024,     2048, 0xbcaffeb7
+0,       2048,       2048,      452,     2048, 0xf1d3c78d, S=1, Skip Samples,  
     10, 0x0172003e
-- 
2.54.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to