/* Returns the size of one sample (in bytes) on the given channel.  */
static unsigned char GetSampleSize(unsigned char channel)
/* Returns the size of one sample (in bytes) on the given channel.  */
static unsigned char GetSampleSize(unsigned char channel)
{
    unsigned int size = 0;
    SANITY_CHECK((channel == AC97C_CHANNEL_A)
                 || (channel == AC97C_CHANNEL_B)
                 || (channel == AC97C_CHANNEL_CODEC));
    switch (channel) {
        case AC97C_CHANNEL_CODEC: return 2;
        case AC97C_CHANNEL_A:
            size = (AT91C_BASE_AC97C->AC97C_CAMR & AT91C_AC97C_SIZE) >> 16;
            break;
        case AC97C_CHANNEL_B:
            size = (AT91C_BASE_AC97C->AC97C_CBMR & AT91C_AC97C_SIZE) >> 16;
            break;
    }
    if ((size & 2) != 0) {
        return 2;
    }
    else {
        return 4;
    }
}