• Anssi Hannula's avatar
    avformat/spdifenc: fix handling of large TrueHD frames · 36e156be
    Anssi Hannula authored
    The TrueHD IEC 61937 encapsulation code uses a very naive method of
    always inserting 24 TrueHD frames evenly in a MAT frame. This does not
    work for larger frames as they may exceed the size of 1/24th of a MAT
    frame.
    
    To fix that, use the input_timing field in the TrueHD frame to determine
    the proper position of the TrueHD frame in the MAT frame. That field is
    basically a dts field, telling the time to feed this frame to the
    decoder in sample count units.
    
    This can cause a TrueHD frame to be split between two MAT frames, so a
    second concatenation hd_buf is added, alternating with the first buffer.
    
    Large frames are preceded by smaller frames that have input_timing
    values that cause the frames to be sent out faster than the nominal rate
    (i.e. increasing decoder latency, long decoder buffer), allowing the
    larger frames to then be sent out slower than the nominal rate as the
    decoder has enough data buffered to keep it busy.
    36e156be
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...