From b789f0a4644c0ad1097de976130af15b7c924754 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 25 Apr 2014 21:53:56 +0200 Subject: Don't insert stale PAD data when the read returns 0 --- src/dabplus-enc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index fc6fa0f..9c00807 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -604,14 +604,17 @@ int main(int argc, char *argv[]) // -------------- AAC Encoding + int calculated_padlen = ret > 0 ? padlen : 0; + + in_ptr[0] = input_buf; in_ptr[1] = pad_buf; in_size[0] = read; - in_size[1] = padlen; + in_size[1] = calculated_padlen; in_elem_size[0] = BYTES_PER_SAMPLE; in_elem_size[1] = sizeof(uint8_t); in_args.numInSamples = input_size/BYTES_PER_SAMPLE; - in_args.numAncBytes = padlen; + in_args.numAncBytes = calculated_padlen; in_buf.bufs = (void**)&in_ptr; in_buf.bufferIdentifiers = in_identifier; -- cgit v1.2.3