IPB

Welcome Guest ( Log In | Register )

Is LAME reenterable?
Istrebitel
post Jul 12 2012, 16:03
Post #1





Group: Members
Posts: 54
Joined: 20-October 10
Member No.: 84756



Greetings.

I am experimenting with Lame from programming point of view, and having wierd results. I have a question - is LAME reenterable, meaning, does it store anything in its inner variables, and can i encode/decode multiple files at once (if i keep multiple global lame structure instances of course)
Go to the top of the page
+Quote Post
 
Start new topic
Replies (1 - 6)
lvqcl
post Jul 12 2012, 16:11
Post #2





Group: Developer
Posts: 3470
Joined: 2-December 07
Member No.: 49183



what functions do you use?
Go to the top of the page
+Quote Post
Istrebitel
post Jul 13 2012, 09:54
Post #3





Group: Members
Posts: 54
Joined: 20-October 10
Member No.: 84756



Well, i basically do the same that command line utility does (one that comes with lame) - i use lame_init, i set different parameters, then i use the encode/decode functions in a loop, then close.
Go to the top of the page
+Quote Post
Istrebitel
post Jul 13 2012, 11:01
Post #4





Group: Members
Posts: 54
Joined: 20-October 10
Member No.: 84756



I found out, the decoder supplied with LAME was actually non-reentrable, not LAME encoder.

In layer3.c at 1645 it reads:

struct III_sideinfo sideinfo;

So, a global variable is declared, and if multiple decodings are attempted at once, chaos ensues.
Go to the top of the page
+Quote Post
lvqcl
post Jul 13 2012, 11:15
Post #5





Group: Developer
Posts: 3470
Joined: 2-December 07
Member No.: 49183



IIRC lame_decode_* functions aren't thread-safe, but hip_decode_* are.

QUOTE
In layer3.c at 1645 it reads:

What version do you use?

This post has been edited by lvqcl: Jul 13 2012, 11:19
Go to the top of the page
+Quote Post
robert
post Jul 13 2012, 13:06
Post #6


LAME developer


Group: Developer
Posts: 789
Joined: 22-September 01
Member No.: 5



I couldn't find any version with that text at line 1645. Anyway, version 3.99.5 should be OK to use, as I fixed that issue during the 3.99 development.

This post has been edited by robert: Jul 13 2012, 13:10
Go to the top of the page
+Quote Post
Istrebitel
post Jul 13 2012, 15:52
Post #7





Group: Members
Posts: 54
Joined: 20-October 10
Member No.: 84756



lvqcl, thanks, is there any official information about thread-safeness of LAME?

Robert, thanks alot.

I think what you mean is that my number at which struct III_sideinfo sideinfo; occurs is different, thats because as i said, i was experimenting, so i could've added some code over that line.

I think i'll just apply those changes i am missing since my version and see if they help.

This post has been edited by Istrebitel: Jul 13 2012, 16:00
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th December 2014 - 16:58