Fix generation of IEC958 subframes

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.
This commit is contained in:
Takashi Iwai 2005-11-17 12:08:32 +00:00
parent 367c3fc6ce
commit 6b85e23fa3

View file

@ -116,10 +116,10 @@ static inline u_int32_t iec958_subframe(snd_pcm_iec958_t *iec, u_int32_t data, i
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' */