diff options
author | Martin Storsjo <martin@martin.st> | 2018-08-31 15:45:42 +0300 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-09-02 23:25:42 +0300 |
commit | ab052fada03e6f024eb9f75cfba85b7097a712d5 (patch) | |
tree | 05c01bc0cbf620f3efe4f935a5993ca4bb0eec3e /aac-enc.c | |
parent | e646f07dbb5fb6630e5d577aa98ec58054305eba (diff) | |
download | fdk-aac-ab052fada03e6f024eb9f75cfba85b7097a712d5.tar.gz fdk-aac-ab052fada03e6f024eb9f75cfba85b7097a712d5.tar.bz2 fdk-aac-ab052fada03e6f024eb9f75cfba85b7097a712d5.zip |
Adjust the aac-enc.c encoding example to fix flushing the encoder with FDKv2
Even with numInSamples == -1, all the buffer pointers need to be non-null.
Diffstat (limited to 'aac-enc.c')
-rw-r--r-- | aac-enc.c | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -196,20 +196,17 @@ int main(int argc, char *argv[]) { const uint8_t* in = &input_buf[2*i]; convert_buf[i] = in[0] | (in[1] << 8); } - if (read <= 0) { - in_args.numInSamples = -1; - } else { - in_ptr = convert_buf; - in_size = read; - in_elem_size = 2; + in_ptr = convert_buf; + in_size = read; + in_elem_size = 2; + + in_args.numInSamples = read <= 0 ? -1 : read/2; + in_buf.numBufs = 1; + in_buf.bufs = &in_ptr; + in_buf.bufferIdentifiers = &in_identifier; + in_buf.bufSizes = &in_size; + in_buf.bufElSizes = &in_elem_size; - in_args.numInSamples = read/2; - in_buf.numBufs = 1; - in_buf.bufs = &in_ptr; - in_buf.bufferIdentifiers = &in_identifier; - in_buf.bufSizes = &in_size; - in_buf.bufElSizes = &in_elem_size; - } out_ptr = outbuf; out_size = sizeof(outbuf); out_elem_size = 1; |