diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-05-27 06:40:52 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-05-29 04:15:30 -0400 |
commit | cdc5c53fde266055debf7f5c9c043d5acf47c5ff (patch) | |
tree | fb2eb8c49c1e2e55d24eebdb2ccbb828322f70e2 | |
parent | a6c17ec89d33a714b3e94a252c127f2ff63363c8 (diff) |
[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>
-rw-r--r-- | sound/core/oss/pcm_oss.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 131522ea4b93..468fca8894d9 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -129,7 +129,16 @@ static long snd_pcm_oss_bytes(snd_pcm_substream_t *substream, long frames) | |||
129 | long bytes = frames_to_bytes(runtime, frames); | 129 | long bytes = frames_to_bytes(runtime, frames); |
130 | if (buffer_size == runtime->oss.buffer_bytes) | 130 | if (buffer_size == runtime->oss.buffer_bytes) |
131 | return bytes; | 131 | return bytes; |
132 | return (long)(((int64_t)runtime->oss.buffer_bytes * (int64_t)bytes) / (int64_t)buffer_size); | 132 | #if BITS_PER_LONG >= 64 |
133 | return runtime->oss.buffer_bytes * bytes / buffer_size; | ||
134 | #else | ||
135 | { | ||
136 | u64 bsize = (u64)runtime->oss.buffer_bytes * (u64)bytes; | ||
137 | u32 rem; | ||
138 | div64_32(&bsize, buffer_size, &rem); | ||
139 | return (long)bsize; | ||
140 | } | ||
141 | #endif | ||
133 | } | 142 | } |
134 | 143 | ||
135 | static long snd_pcm_alsa_frames(snd_pcm_substream_t *substream, long bytes) | 144 | static long snd_pcm_alsa_frames(snd_pcm_substream_t *substream, long bytes) |