[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mp3encoder
Subject:    [mp3encoder] id3tag_set_*() and arg2 allocation
From:       Lynn Pye <lynn () pyehouse ! com>
Date:       2004-03-26 4:52:39
Message-ID: 68855192-7EE1-11D8-A75E-000393A580D4 () pyehouse ! com
[Download RAW message or body]

Is it my imagination or does the developer need to allocate and keep in 
storage space for the second argument to each of the id3tag_set_XXX() 
calls (like id3tag_set_title(lame_global_flags*,const char*)?

It appears that an internal const char* simply gets assigned the 
pointer value of the second argument and lame_close() doesn't appear to 
attempt a free() on that allocation.

So it seems I need to allocate via declaration or malloc the space to 
be used, push the data into it, pass it as the second argument, keep it 
around until the conversion is complete, and then free (or let it go 
off of the stack if I declared it as a char array of fixed length).

Is that about right?

Also, I have a track name with an accented 'ñ' (like the 3rd character 
in the Spanish word for 'boy'), which when it is set via the 
id3tag_set_title() call ends up with gobbledygook for that letter (the 
rest of the title is correct). Do these methods handle Unicode (which 
I'm attempting to pass in)?

Thanks,

Lynn
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic