fix entries for U24_BE and U24_LE in pcm_formats[] array
PATCH 1/1 fix entries for U24_BE and U24_LE in pcm_formats[] array
SNDRV_PCM_FORMAT_U24_BE and SNDRV_PCM_FORMAT_U24_LE represent 24-bit samples that are aligned into a 4-byte word, so the most significant byte is always zero. The entries for these two sample formats in the pcm_formats[] array only specified 3 bytes. For SNDRV_PCM_FORMAT_U24_LE, the compiler automatically adds the 4th byte, but for SNDRV_PCM_FORMAT_U24_BE the entry was just wrong. This patch fixes both entries.
---
I do not have hardware that supports U24_BE, so I can't test this change.
sound/core/pcm_misc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/core/pcm_misc.c +2 -2
@@ -71,11 +71,11 @@ static struct pcm_format_data pcm_formats[SNDRV_PCM_FORMAT_LAST+1] = { }, [SNDRV_PCM_FORMAT_U24_LE] = { .width = 24, .phys = 32, .le = 1, .signd = 0, - .silence = { 0x00, 0x00, 0x80 }, + .silence = { 0x00, 0x00, 0x80, 0x00 }, }, [SNDRV_PCM_FORMAT_U24_BE] = { .width = 24, .phys = 32, .le = 0, .signd = 0, - .silence = { 0x80, 0x00, 0x00 }, + .silence = { 0x00, 0x80, 0x00, 0x00 }, }, [SNDRV_PCM_FORMAT_S32_LE] = { .width = 32, .phys = 32, .le = 1, .signd = 1,
Signature · 1 line
1.5.2.4
At Thu, 20 Dec 2007 14:43:14 -0600,
Quoted 9 lines · Timur Tabi
SNDRV_PCM_FORMAT_U24_BEandSNDRV_PCM_FORMAT_U24_LErepresent 24-bit samples that are aligned into a 4-byte word, so the most significant byte is always zero. The entries for these two sample formats in the pcm_formats[] array only specified 3 bytes. ForSNDRV_PCM_FORMAT_U24_LE, the compiler automatically adds the 4th byte, but forSNDRV_PCM_FORMAT_U24_BEthe entry was just wrong. This patch fixes both entries.Signed-off-by Timur Tabi <[email protected]>
U24_BE was already fixed on HG tree...
Takashi