[MPlayer-dev-eng] [PATCH] Fix channel reordering for 24-bit audio
Jason Tackaberry
tack at urandom.ca
Fri Nov 13 04:19:35 CET 2009
Hi,
Having obtained a few 24-bit wave files [1], I noticed that the audio
was getting mangled during reordering.
The problem is that only a third of the samples in any given buffer were
getting reordered. The remaining two thirds were unchanged. With the
8-, 16-, and 32-bit cases, the buffer is treated as either int8_t*,
int16_t*, or int32_t*, so can be iterated over n_samples. With the
24-bit case, the buffer is treated as int8_t* and therefore must be
iterated over n_samples*3.
Near as I can tell, reordering 24-bit audio has _never_ worked. I
suppose that's possible given that 24-bit content seems rare. (Less
rare is 24-bit flac, but ffflac decodes that as s32le so the 24-bit
paths are not travelled).
Although the fix seems obvious to me, since I find it slightly hard to
believe something this basic has never worked, rather than checking it
straight in I thought it could do with review.
Thanks,
Jason.
[1] http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 24bit-reorder.patch
Type: text/x-patch
Size: 3544 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20091112/c6a31489/attachment.bin>
More information about the MPlayer-dev-eng
mailing list