summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-12-07 15:28:07 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:30:41 +0100
commit235475cb7715852c42118fd8d8ec67b534ab6e8b (patch)
tree8d05766a01706371431513d6ce7ce7d0b2cd6bab /sound/core
parent4a471b7ddfe76e39c1633d5a23a687f4b5fc0d8d (diff)
downloadlinux-235475cb7715852c42118fd8d8ec67b534ab6e8b.tar.bz2
[ALSA] pcm - Fix wrong asserts
Modules: PCM Midlevel Fixed wrong or supreflous snd_assert()'s. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index c58ec67d1cbf..eeba2f060955 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -56,9 +56,8 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
runtime->silence_filled = 0;
runtime->silence_start = runtime->control->appl_ptr;
}
- if (runtime->silence_filled == runtime->buffer_size)
+ if (runtime->silence_filled >= runtime->buffer_size)
return;
- snd_assert(runtime->silence_filled <= runtime->buffer_size, return);
noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled;
if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold)
return;
@@ -2006,8 +2005,8 @@ void snd_pcm_tick_prepare(struct snd_pcm_substream *substream)
runtime->silence_filled < runtime->buffer_size) {
snd_pcm_sframes_t noise_dist;
noise_dist = snd_pcm_playback_hw_avail(runtime) + runtime->silence_filled;
- snd_assert(noise_dist <= (snd_pcm_sframes_t)runtime->silence_threshold, );
- frames = noise_dist - runtime->silence_threshold;
+ if (noise_dist > (snd_pcm_sframes_t)runtime->silence_threshold)
+ frames = noise_dist - runtime->silence_threshold;
}
avail = snd_pcm_playback_avail(runtime);
} else {