mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
fixed compile warnings.
This commit is contained in:
parent
494f3e66e4
commit
965222c3d9
4 changed files with 18 additions and 11 deletions
|
|
@ -1105,7 +1105,7 @@ static int simple_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2
|
||||||
* \return 0 on success otherwise a negative error code
|
* \return 0 on success otherwise a negative error code
|
||||||
*/
|
*/
|
||||||
int snd_mixer_selem_register(snd_mixer_t *mixer, struct
|
int snd_mixer_selem_register(snd_mixer_t *mixer, struct
|
||||||
snd_mixer_selem_regopt *options,
|
snd_mixer_selem_regopt *options ATTRIBUTE_UNUSED,
|
||||||
snd_mixer_class_t **classp)
|
snd_mixer_class_t **classp)
|
||||||
{
|
{
|
||||||
snd_mixer_class_t *class = calloc(1, sizeof(*class));
|
snd_mixer_class_t *class = calloc(1, sizeof(*class));
|
||||||
|
|
|
||||||
|
|
@ -2168,9 +2168,10 @@ int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes
|
||||||
silence = snd_pcm_format_silence_64(format);
|
silence = snd_pcm_format_silence_64(format);
|
||||||
if (dst_area->step == (unsigned int) width) {
|
if (dst_area->step == (unsigned int) width) {
|
||||||
unsigned int dwords = samples * width / 64;
|
unsigned int dwords = samples * width / 64;
|
||||||
|
u_int64_t *dstp = (u_int64_t *)dst;
|
||||||
samples -= dwords * 64 / width;
|
samples -= dwords * 64 / width;
|
||||||
while (dwords-- > 0)
|
while (dwords-- > 0)
|
||||||
*((u_int64_t*)dst)++ = silence;
|
*dstp++ = silence;
|
||||||
if (samples == 0)
|
if (samples == 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,8 @@ static inline int snd_pcm_check_error(snd_pcm_t *pcm, int err)
|
||||||
return -ESTRPIPE;
|
return -ESTRPIPE;
|
||||||
case SND_PCM_STATE_DISCONNECTED:
|
case SND_PCM_STATE_DISCONNECTED:
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -564,28 +564,30 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int
|
||||||
}
|
}
|
||||||
case 16: {
|
case 16: {
|
||||||
u_int16_t silence = snd_pcm_format_silence_64(format);
|
u_int16_t silence = snd_pcm_format_silence_64(format);
|
||||||
|
u_int16_t *pdata = (u_int16_t *)data;
|
||||||
if (! silence)
|
if (! silence)
|
||||||
memset(data, 0, samples * 2);
|
memset(data, 0, samples * 2);
|
||||||
else {
|
else {
|
||||||
while (samples-- > 0)
|
while (samples-- > 0)
|
||||||
*((u_int16_t *)data)++ = silence;
|
*pdata++ = silence;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 24: {
|
case 24: {
|
||||||
u_int32_t silence = snd_pcm_format_silence_64(format);
|
u_int32_t silence = snd_pcm_format_silence_64(format);
|
||||||
|
u_int8_t *pdata = (u_int8_t *)data;
|
||||||
if (! silence)
|
if (! silence)
|
||||||
memset(data, 0, samples * 3);
|
memset(data, 0, samples * 3);
|
||||||
else {
|
else {
|
||||||
while (samples-- > 0) {
|
while (samples-- > 0) {
|
||||||
#ifdef SNDRV_LITTLE_ENDIAN
|
#ifdef SNDRV_LITTLE_ENDIAN
|
||||||
*((u_int8_t *)data)++ = silence >> 0;
|
*pdata++ = silence >> 0;
|
||||||
*((u_int8_t *)data)++ = silence >> 8;
|
*pdata++ = silence >> 8;
|
||||||
*((u_int8_t *)data)++ = silence >> 16;
|
*pdata++ = silence >> 16;
|
||||||
#else
|
#else
|
||||||
*((u_int8_t *)data)++ = silence >> 16;
|
*pdata++ = silence >> 16;
|
||||||
*((u_int8_t *)data)++ = silence >> 8;
|
*pdata++ = silence >> 8;
|
||||||
*((u_int8_t *)data)++ = silence >> 0;
|
*pdata++ = silence >> 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -593,21 +595,23 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int
|
||||||
}
|
}
|
||||||
case 32: {
|
case 32: {
|
||||||
u_int32_t silence = snd_pcm_format_silence_64(format);
|
u_int32_t silence = snd_pcm_format_silence_64(format);
|
||||||
|
u_int32_t *pdata = (u_int32_t *)data;
|
||||||
if (! silence)
|
if (! silence)
|
||||||
memset(data, 0, samples * 4);
|
memset(data, 0, samples * 4);
|
||||||
else {
|
else {
|
||||||
while (samples-- > 0)
|
while (samples-- > 0)
|
||||||
*((u_int32_t *)data)++ = silence;
|
*pdata++ = silence;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 64: {
|
case 64: {
|
||||||
u_int64_t silence = snd_pcm_format_silence_64(format);
|
u_int64_t silence = snd_pcm_format_silence_64(format);
|
||||||
|
u_int64_t *pdata = (u_int64_t *)data;
|
||||||
if (! silence)
|
if (! silence)
|
||||||
memset(data, 0, samples * 8);
|
memset(data, 0, samples * 8);
|
||||||
else {
|
else {
|
||||||
while (samples-- > 0)
|
while (samples-- > 0)
|
||||||
*((u_int64_t *)data)++ = silence;
|
*pdata++ = silence;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue