[FFmpeg-devel] [PATCH] avformat/spdifenc: handle long TrueHD input_timing gaps

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Apr 13 20:16:23 EEST 2020


Am So., 12. Apr. 2020 um 21:56 Uhr schrieb Anssi Hannula <anssi.hannula at iki.fi>:
>
> Some TrueHD streams contain frames that have very long gaps in
> input_timing fields, while output_timing remains constant-rate. These
> are likely due to encoding discontinuities of some sort as the TrueHD
> substream terminator marker is observed before the gap.
>
> Such frames trigger a sanity check in the current code - however, such
> gaps are valid.
>
> The gaps require us to insert many IEC 61937 bursts worth of MAT padding
> into the output. To facilitate that, add a mechanism in
> spdif_write_packet() to allow writing out multiple bursts per AVPacket,
> and use that in spdif_header_truehd() to write out any full bursts that
> do not yet contain any actual audio data from the current AVPacket.
>
> Modify the sanity check to allow up to 50 MAT frames full of padding.
>
> Fixes: incredibles2-truehd-bitstreaming.thd

Works fine with my receiver, maybe Hendrik wants to comment.

Carl Eugen


More information about the ffmpeg-devel mailing list