[MPlayer-dev-eng] WAV File Demuxing

Mike Melanson melanson at pcisys.net
Sat Feb 16 22:50:49 CET 2002


On Sat, 16 Feb 2002, Alex Beregszaszi wrote:

> Yes, it fixes it, thank you ;)
> Also why does it handles data with junk so bad ? (adpcm decoder)

	You can draw comparisons between the ADPCM decoder and many other
things, such as life: What you get out of it depends on what you put into
it...:) The ADPCM decoder(s), like all of the audio and video decoders,
expect data to arrive in a certain format. The first 7-14 bytes (depending
on stereo mode) of MS ADPCM data is supposed to have a bunch of numbers
used in decoding the next 1000-2000 PCM samples. If you were to feed MP3
data to an MP3 decoder starting with the wrong byte in the stream, I'm
pretty sure the resultant audio wouldn't sound very pleasing either. The
raw PCM data from WAV files wasn't playing correctly either, but because
each 8-16 bits decodes to an individual sample independently, the problem
wasn't as audible.

	A big issue with predictive algorithms like this is that they're
not very fault-tolerant. If there's an error in the stream, everything
after the error comes out wrong. This may be why IMA ADPCM has such small
block sizes. Of course, if the preamble is bad to begin with (as was the
case here), none of the sound will be right.

	However, I have added some new sanity checks to the ADPCM decoders
and will commit those sometime, so hopefully it becomes more visible when
something goes wrong and the audio sounds bad.

> It always gets locked when it finished to play an WAV.

	Does anyone know why yet? Is there a movement afoot to fix the
issue?

	Thanks...
-- 
	-Mike Melanson




More information about the MPlayer-dev-eng mailing list