I've written an ActiveX control that uses the LAME library to convert WAV
files to MP3 files (I did this because I couldn't seem to find the LameX
control on the web).
I'm willing to either (a) put this into the LAME "source pool" or (b)
publish it as an adjunct to LAME.
I think option (a), however, requires some modifications to the LAME source
code. I also have some questions about the LAME code that I bet someone on
this list can answer. Or educate me on what I'm getting confused about,
which is just as good <grin>...
1) The ActiveX control currently does not use lame_init to initialize the
lame global flags structure. Instead, it does its own initialization, based
on user-selected values for a variety of properties that the control exposes
(I can explain why I took this approach if anyone is interested, or would
like to offer some alternatives). Because lame_init initializes some private
memory structures, I had to modify lame.h and lame.c to publicly expose
those initialization routines. This entailed adding the following to lame.c
(with corresponding entries put into lame.h):
void xlame_init_private_struc()
{
memset(&bs, 0, sizeof(Bit_stream_struc));
memset(&l3_side,0x00,sizeof(III_side_info_t));
init_bit_stream_w(&bs);
}
void xlame_init_scalefac(lame_global_flags *gfp)
{
int i;
for (i = 0; i < SBMAX_l + 1; i++) {
scalefac_band.l[i] =
sfBandIndex[gfp->samplerate_index + (gfp->version * 3)].l[i];
}
for (i = 0; i < SBMAX_s + 1; i++) {
scalefac_band.s[i] =
sfBandIndex[gfp->samplerate_index + (gfp->version * 3)].s[i];
}
}
2) I am a little concerned that the LAME code may not be re-entrant, which I
think could cause oddball problems for users of an ActiveX control. My
concern is based on those same private structures that I cited in (1), and
any other similar structures that may exist in the code base.
If two instances of the ActiveX control (in the same container program) try
to do conversions simultaneously I think there is the potential for
conflict.
Would it be possible to put all of the structures used in a conversion into
the lame global flags structure? That way each conversion would be an
independent, stand-alone activity.
- Mark
mark@REMOVETHIS [EMAIL PROTECTED]
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )