1
0
Fork 0

[ALSA] Fix compilation on 32bit arch

ALSA<-OSS emulation
Fix the division with int64 for 32bit architectures.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
hifive-unleashed-5.1
Takashi Iwai 2005-05-27 12:40:52 +02:00 committed by Jaroslav Kysela
parent a6c17ec89d
commit cdc5c53fde
1 changed files with 10 additions and 1 deletions

View File

@ -129,7 +129,16 @@ static long snd_pcm_oss_bytes(snd_pcm_substream_t *substream, long frames)
long bytes = frames_to_bytes(runtime, frames);
if (buffer_size == runtime->oss.buffer_bytes)
return bytes;
return (long)(((int64_t)runtime->oss.buffer_bytes * (int64_t)bytes) / (int64_t)buffer_size);
#if BITS_PER_LONG >= 64
return runtime->oss.buffer_bytes * bytes / buffer_size;
#else
{
u64 bsize = (u64)runtime->oss.buffer_bytes * (u64)bytes;
u32 rem;
div64_32(&bsize, buffer_size, &rem);
return (long)bsize;
}
#endif
}
static long snd_pcm_alsa_frames(snd_pcm_substream_t *substream, long bytes)