diff options
| author | Jaroslav Kysela <perex@perex.cz> | 2010-09-29 18:16:50 -0400 |
|---|---|---|
| committer | Jaroslav Kysela <perex@perex.cz> | 2010-09-29 18:20:17 -0400 |
| commit | 20d9a26dbbbec32aa7c9da49b979f201bd7104b9 (patch) | |
| tree | 3e62375a017c13d4b458c2d42121c943f64d16f2 /sound/drivers | |
| parent | 1446c5fba73044a1c72153e1203b23b1820431c5 (diff) | |
ALSA: snd-aloop - fix capture buffer silence
In a special case, some old samples are left in the capture ring buffer.
Fix it.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/drivers')
| -rw-r--r-- | sound/drivers/aloop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index f2b8f868d97..2748fee8d40 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c | |||
| @@ -347,7 +347,7 @@ static void copy_play_buf(struct loopback_pcm *play, | |||
| 347 | unsigned int bytes) | 347 | unsigned int bytes) |
| 348 | { | 348 | { |
| 349 | struct snd_pcm_runtime *runtime = play->substream->runtime; | 349 | struct snd_pcm_runtime *runtime = play->substream->runtime; |
| 350 | char *src = play->substream->runtime->dma_area; | 350 | char *src = runtime->dma_area; |
| 351 | char *dst = capt->substream->runtime->dma_area; | 351 | char *dst = capt->substream->runtime->dma_area; |
| 352 | unsigned int src_off = play->buf_pos; | 352 | unsigned int src_off = play->buf_pos; |
| 353 | unsigned int dst_off = capt->buf_pos; | 353 | unsigned int dst_off = capt->buf_pos; |
| @@ -385,8 +385,10 @@ static void copy_play_buf(struct loopback_pcm *play, | |||
| 385 | dst_off = (dst_off + size) % capt->pcm_buffer_size; | 385 | dst_off = (dst_off + size) % capt->pcm_buffer_size; |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | if (clear_bytes > 0) | 388 | if (clear_bytes > 0) { |
| 389 | clear_capture_buf(capt, clear_bytes); | 389 | clear_capture_buf(capt, clear_bytes); |
| 390 | capt->silent_size = 0; | ||
| 391 | } | ||
| 390 | } | 392 | } |
| 391 | 393 | ||
| 392 | #define BYTEPOS_UPDATE_POSONLY 0 | 394 | #define BYTEPOS_UPDATE_POSONLY 0 |
