Opened 19 years ago

Closed 19 years ago

#1941 closed defect (fixed)

ALL: Compressed BUN files play incorrectly on BE systems

Reported by: SF/pdenouel Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Monkey Island 3

Description

SYMPTOM:

When using mp3 compressed .BUN file (compressed with compress_scumm_bun) there is noise instead of music & voices

REASON:

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 fingolfin, 19 years ago

Owner: set to aquadran

comment:2 by fingolfin, 19 years ago

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.

comment:3 by aquadran, 19 years ago

i looked a bit into, but i can't find endian problem in code.

comment:4 by fingolfin, 19 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 fingolfin, 19 years ago

Owner: changed from aquadran to fingolfin
Resolution: fixed
Status: newclosed
Summary: MP3 compressed *.BUN MacOS XALL: Compressed BUN files play incorrectly on BE systems

comment:6 by fingolfin, 19 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.

Note: See TracTickets for help on using tickets.