From: Nicolas Boullis <nboullis@debian.org>
While working on an ALSA driver for the audio part of em8300-based MPEG
decoder boards (Sigma Designs' Hollywood+ boards and Creative Labs' DXR3
boards), I think I discovered a bug in the code that generates IEC958
subframes from linear samples (iec958 plugin): M and W preambles are
swapped, and B preambles should only be used on even subframes. The
attached patch fixes this issue.
data |= 0x80000000;
/* Preamble */
- if (! iec->counter)
- data |= iec->preamble[PREAMBLE_Z]; /* Block start, 'Z' */
- else if (! channel)
+ if (channel)
data |= iec->preamble[PREAMBLE_Y]; /* odd sub frame, 'Y' */
+ else if (! iec->counter)
+ data |= iec->preamble[PREAMBLE_Z]; /* Block start, 'Z' */
else
data |= iec->preamble[PREAMBLE_X]; /* even sub frame, 'X' */