HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: bbsforu on 2012-01-17 07:07:52

Title: linking dynamic libarary (libmp3lame.so) - Segmentation Fault at lame_
Post by: bbsforu on 2012-01-17 07:07:52
Hi. my name is andrew. I have a question about using Lame.
I'm making LAME's frontend program on linux using libmp3lame.so for practice.
I composed a single main function which is doing specific encoding options.(same as default option)
referecing API documents,
The library file is linked dynamically and I'm calling inner functions through invoke functions..
I checked global variables and flags before call lame_encode_buffer_int()

But when i call the lame_encode_buffer_int(), It always stops with segmentation fault at the end of
lame_copy_inbuffer() in lame.c. My source code is almost same as frontend's lame_main.c and main.c.
A strange thing is that the segmentation fault always arise at the lame_encode_buffer_int 's second call.

I printed with every buffer's data with printf, but the flow ends with Segmentation Fault when it prints around
the end of arrays(or buffer). OTL...

Please give me if you have any tips about this problem.