[ lame-Support Requests-3474730 ] Segmentation Fault at the end of lame_copy_inbuffer()
SourceForge.net <[email protected]>
| Newsgroups | gmane.comp.audio.mp3.lame |
|---|---|
| Message-ID | <[email protected]> |
Support Requests item #3474730, was opened at 2012-01-16 22:54
Message generated for change (Comment added) made by robert
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=200290&aid=3474730&group_id=290
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Priority: 5
Private: No
Submitted By: boram yoon (andrewyoon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Segmentation Fault at the end of lame_copy_inbuffer()
Initial Comment:
Hi, my name is Andrew.
I'm making frontend program on linux using libmp3lame.so for practice before porting to Android.
I composed a single main function which is dong 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
And strange thing is that the segmentation fault always arise at the second call.
I printed with printf every buffer's data, but the flow ends with Segmentation Fault when it prints aroud
the end of arrays(or buffer). OTL...
Please give me if you have tips about this problem. please. I'm doing this for three days..
----------------------------------------------------------------------
>Comment By: Robert Hegemann (robert)
Date: 2012-02-14 02:12
Message:
Just reran 'configure --enable shared --enable-dynamic-frontend', the
resulting lame binary is dynamically linked against libmp3lame.so.0 as
confirmed by ldd, it uses lame_encode_buffer_int and encodes input data
just fine.
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-02-13 22:31
Message:
I think this library doesn't support dynamic link well.
I just wanted to ask whether you have tested.(linking dynamically
not only just lame_get_version(), but also lame_encode_buffer_int() )
thank you.
----------------------------------------------------------------------
Comment By: Robert Hegemann (robert)
Date: 2012-01-31 00:25
Message:
Sounds like you are bypassing the LAME API and doing some nasty things.
Just curious, what do you need that isn't part of the API already?
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-01-30 18:49
Message:
I solved the problem, and completed.
The problem was extern variables and function pointers.
by calling determined functions and declaring some extern
variables in lame.h.
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-01-20 00:52
Message:
please comment how to make Makefile (making .so file) or
where can i focus on the distributed Makefile if you want to..
I tried but.... I stopped because of the length.
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-01-20 00:45
Message:
i'm doing now. thanks robert :) but I didn't complete the porting.
I think if i want to use this engine by linking dynamically, the "make"
tool options should be changed i guess. With the imported Makefile in the
distributed the latest version
code(lame 3.99.3),
I checked all the steps from lame_init_params..
and all the inner values of gfp and gfc, (i compared frontend's value and
my code's value
one by one..)
and I found that some variables of gfc and gfp and some extern variables
haven't been
initialized when I reference the variables from the other source code(not
declared)
It's after init function had been called already.(I checked the values had
been changed in init function, but after the function finished the values
are not changed..)
for example adj43asm[ ] values and pow20[ ] values are always 0 when the
program runs quantize_lines_xrpow( ) in takehiro.c
because I'm newbie to make Makefile but I think setting all the extern
variables every time when i use them will take time...I'm comparing which
one should i choose. May I ask which choice would be better? and isn't
wrong what I'm thinking?
-Andrew.
----------------------------------------------------------------------
Comment By: Robert Hegemann (robert)
Date: 2012-01-18 00:12
Message:
When these function pointers weren't set, then make sure you didn't forget
to call lame_init_params before doing the actual encoding.
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-01-17 18:28
Message:
just calling default function(CBR_iteration_loop, fht, init_xrpow_core_c)
instead of referencing gfc and not changing
there inner codes.
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-01-17 18:08
Message:
thank you. I did more works. : )
I traced and changed library codes.
I think there was problems in calling function pointer.
gfc->iteration_loop() (encoder.c)
gfc->fft_fht() (fft.c)
gfc->init_xrpow_core() (quantize.c)
they are function pointer, and there initialization was not completed i
think.
I have a question. I'm trying to convert raw PCM wave file to mp3
files(320, 128, 192..)
Are there any problems fixing these functions above to encode simply?
I changed the codes not to reference gfc flags,
and just used local or default functions.
( CBR_iteration_loot(), fht(), init_xrpow_core_c() )
----------------------------------------------------------------------
Comment By: Robert Hegemann (robert)
Date: 2012-01-17 01:51
Message:
>From the little information at hand, it sounds like you are counting the
number of input samples wrong.
----------------------------------------------------------------------
Comment By: boram yoon (andrewyoon)
Date: 2012-01-16 22:58
Message:
I'm sorry. i just know here is not for support question board.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=200290&aid=3474730&group_id=290
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d