#426 Bad mono encoding when using the interleaved functions

closed-invalid
nobody
Libraries (86)
5
2012-10-13
2012-07-29
Anonymous
No

When using the interleaved functions (such as lame_encode_buffer_interleaved) for encoding a mono stream, bad output is coming out.
Further investigation lead to a problem in lame_encode_buffer_template. When cfg->channels_in == 1, it calls lame_copy_inbuffer(gfc, buffer_l, buffer_r, nsamples, pcm_type, aa, norm); The value of aa is set to 2 when called from the interleaved functions. The aa parameter is passed on to lame_copy_inbuffer and define the jump value when copying the buffer. Jump value of 2 for mono stream result in skipping each second sample and accessing data beyond the buffer boundaries.

Discussion

  • The interleaved functions always expect left and right channel data, see lame.h.

     
    • status: open --> closed-invalid