Files
ffmpeg/libavformat
Nathan Lucas 2db563fac2 avformat/spdifenc: preserve TrueHD MAT padding across branches
Some TrueHD streams, particularly remuxes of seamless branching Blu-rays,
contain input_timing gaps that require more padding than the current
MAT_FRAME_SIZE / 2 limit allows.  spdifenc treats this padding as
invalid and drops it, breaking MAT timing and IEC 61937 carrier cadence,
causing TrueHD/Atmos dropouts on some receivers.

Allow larger valid padding gaps and queue completed MAT buffers so the
muxer can preserve the carrier cadence while still writing at most one
MAT buffer per input packet.

Some branches also have discontinuous timing, so input_timing cannot be
directly used to compute padding at those boundaries.  When output_timing
is available from a TrueHD restart header, use it to detect those
discontinuities and compute padding from the change in
output_timing - input_timing offset across the boundary instead.

Fixes: https://trac.ffmpeg.org/ticket/9569
Fixes: https://trac.ffmpeg.org/ticket/10948
See also: https://github.com/mpv-player/mpv/issues/9659
See also: https://github.com/mpv-player/mpv/issues/13943

Signed-off-by: Nathan Lucas <nlucasgit@gmail.com>
2026-07-25 20:12:16 -06:00
..
2025-08-03 13:48:47 +02:00
2026-03-10 13:52:18 +01:00
2025-09-08 20:59:31 +00:00
2025-04-13 22:49:21 +02:00
2026-06-23 19:15:57 +02:00
2024-03-31 00:08:43 +01:00
2025-08-03 13:48:47 +02:00
2026-07-13 19:35:48 +00:00
2026-03-10 13:52:18 +01:00
2024-03-26 06:36:43 +01:00
2026-06-23 19:15:57 +02:00
2026-03-10 13:52:18 +01:00
2026-06-23 19:15:57 +02:00
2026-05-08 09:34:52 +02:00
2026-06-23 19:15:57 +02:00
2025-08-03 13:48:47 +02:00
2026-02-19 17:18:11 +01:00
2026-03-10 13:52:18 +01:00
2026-03-10 13:52:18 +01:00
2026-06-23 19:15:57 +02:00
2024-06-19 10:12:50 -03:00
2026-06-23 19:15:57 +02:00
2022-03-16 14:05:26 +02:00
2026-05-29 01:49:20 +00:00
2024-03-26 06:36:43 +01:00
2025-08-03 13:48:47 +02:00
2025-06-23 17:19:18 +10:00
2026-02-25 02:55:43 +00:00
2025-08-03 13:48:47 +02:00
2024-06-04 11:46:27 +02:00
2024-07-21 16:41:23 +02:00
2026-02-18 08:20:10 +00:00
2023-05-31 09:03:58 -07:00
2022-02-24 12:56:49 +01:00
2025-08-03 13:48:47 +02:00
2026-06-16 09:18:24 -03:00
2024-04-17 18:31:06 +05:30
2024-05-01 02:57:12 +02:00
2026-03-10 13:52:18 +01:00
2025-08-03 13:48:47 +02:00
2024-04-06 12:59:56 +02:00
2025-08-04 03:59:42 +00:00
2025-08-03 13:48:47 +02:00
2026-04-28 12:29:37 +00:00
2024-03-31 00:08:43 +01:00
2026-03-10 13:52:18 +01:00
2026-07-10 17:45:09 +00:00
2025-03-28 15:23:28 +01:00
2026-07-13 19:35:48 +00:00
2024-03-31 00:08:43 +01:00
2026-05-03 13:26:34 +00:00
2025-08-03 13:48:47 +02:00
2026-06-23 19:13:06 +02:00
2024-11-03 10:53:15 +11:00
2026-05-03 18:22:46 +02:00
2026-03-10 13:52:18 +01:00
2025-06-23 17:19:18 +10:00
2024-03-15 12:51:15 +01:00
2024-03-15 12:51:15 +01:00
2022-03-26 00:42:00 +02:00
2026-02-08 02:25:14 +01:00
2026-03-10 13:52:18 +01:00
2025-08-03 13:48:47 +02:00
2024-03-31 00:08:43 +01:00
2026-03-10 13:52:18 +01:00
2026-06-23 19:15:57 +02:00
2026-03-10 13:52:18 +01:00
2024-07-21 17:02:11 +02:00
2024-03-26 06:36:43 +01:00
2026-02-25 02:55:43 +00:00
2026-03-10 13:52:18 +01:00
2025-08-03 13:48:47 +02:00
2024-03-26 06:36:43 +01:00