孟 飞 wrote:
i am porting the libMAD to palm device, which is responsible
for decoding mp3 to original wave data. there is some strange
problems, the biggest one, is about MemGluePtrNew() API. for
decode large chunk of data, i need a memory chunk larger than
64k, so i allocated that by calling MemGluePtrNew, say 600k,
when i transfer the pointer to libMAD decode function, the
returned data length is only about 5k, while it should be at least more than 100k. but when i decode a short mp3 data, say
2k, with a pointer allocated by MemPtrNew(), it could return
the correct data about, say 20k.

My guess is that libMAD assumes that an "int" is 32 bits or
larger, but many Palm compilers make "int" a 16-bit integer
by default.  Having 16-bit integers as the default for "int"
used to be quite common, but now it is not, and lots of code
will probably break if it is compiled on a machine where an
"int" isn't (at least) 32 bits.

If this is the case, there are two possible ways to fix it:
change the compiler options so that "int" is 32 bits, or
modify the library (probably by replacing "int" with a type
created by "typedef") so that it doesn't make this assumption
anymore.

  - Logan

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to