Opened 18 years ago
Closed 18 years ago
#1941 closed defect (fixed)
ALL: Compressed BUN files play incorrectly on BE systems
|Reported by:||SF/pdenouel||Owned by:||fingolfin|
|Cc:||Game:||Monkey Island 3|
When using mp3 compressed .BUN file (compressed with compress_scumm_bun) there is noise instead of music & voices
There is an endianness problem in mp3.cpp for MacOS X version of ScummVM during the scaling of the samples in the function MP3InputStream::readBuffer
SOLUTION EXAMPLE (MAC OS X only):
*buffer = (int16) scale_sample (frame); *buffer = (*buffer >> 8) & 0xFF | (*buffer << 8) & 0xFF00; *buffer++;
Ticket imported from: #1153648. Ticket imported from: bugs/1941.
Change History (6)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
comment:3 by , 18 years ago
i looked a bit into, but i can't find endian problem in code.
comment:4 by , 18 years ago
Note that I am just guessing there, aquadran. Maybe the compress_scumm_bun code has an endian bug, maybe the playback code in ScummVM itself for the compressed code has an endian bug; maybe neither has a bug and the problem lies elsewhere...
I guess I am in a good position to find out, I just need to compress my BUN files and try whether I can reproduce the problem, and if I can reproduce it, see whether I can fix it... But for now, I have no time. Maybe during one of the coming weekends I'll be able to check this out.
comment:5 by , 18 years ago
|Status:||new → closed|
|Summary:||MP3 compressed *.BUN MacOS X → ALL: Compressed BUN files play incorrectly on BE systems|
comment:6 by , 18 years ago
Fixed in CVS.
The playback code in dimuse.cpp always set the little endian flag. However, MP3/Ogg streams produce data in native endianess.
Nope, that's not correct. The MP3 playback code (which, BTW, is well tested and even was *written* on a Mac OS X machine) is meant to produce "nativen endian" output, which it currently does. From my point of view, the code is perfectly endian safe already now.
It's much more likely that the BUN compressor is having an endianess problem.