Fix writing of planar audio to export buffers in some cases (#2223).
authorCarl Hetherington <cth@carlh.net>
Wed, 30 Mar 2022 20:59:05 +0000 (22:59 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 30 Mar 2022 20:59:05 +0000 (22:59 +0200)
commitbd5c164496bcb86c41ae8ac42241a652ee3a1b14
tree01a4bfc802bc0084244346497f8d4c6ae30acd83
parent0e6dc8bedbb7d6b621f24a864403240973322677
Fix writing of planar audio to export buffers in some cases (#2223).

Previously we did not take into account alignment padding that can
exist with FLTP samples; each channel's block of samples can have
a gap between.  This doesn't happen with the normal 1024 sample blocks;
only when flushing at the end, when we write shorter blocks.

Not doing this right meant that we were passing uninitialised memory
to aacenc which sometimes responded by returning an EINVAL due to one
of its internal calculations returning a NaN.
src/lib/ffmpeg_file_encoder.cc