diff options
author | Eric Laurent <elaurent@google.com> | 2010-11-03 16:38:43 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-11-04 11:34:49 -0700 |
commit | a0c12403e9ee9553bc4f6f054b16fde79accfa0f (patch) | |
tree | fff4dd7ed1dced96d19688f7a872f80a0bbe9518 /libaudio2 | |
parent | f893585c3f13c2ad3f02cf758e940a8a79b5c595 (diff) | |
download | device_samsung_crespo-a0c12403e9ee9553bc4f6f054b16fde79accfa0f.zip device_samsung_crespo-a0c12403e9ee9553bc4f6f054b16fde79accfa0f.tar.gz device_samsung_crespo-a0c12403e9ee9553bc4f6f054b16fde79accfa0f.tar.bz2 |
Issue 3137532: removed garbage at start of capture
The first call to pcm_read() just starts PCM capture and does not return any
data although the read status is valid. Data present in memory where the read
buffer was allocated is fed to the resampler for the first audio buffer.
The fix consists in modifying pcm_read() to return valid data from the first read.
Change-Id: I489e398db570e709d1f64507b67a433d6a36c3d1
Diffstat (limited to 'libaudio2')
-rw-r--r-- | libaudio2/alsa_pcm.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libaudio2/alsa_pcm.c b/libaudio2/alsa_pcm.c index 6bafc7a..5673391 100644 --- a/libaudio2/alsa_pcm.c +++ b/libaudio2/alsa_pcm.c @@ -275,7 +275,6 @@ int pcm_read(struct pcm *pcm, void *data, unsigned count) if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_START)) return oops(pcm, errno, "cannot start channel"); pcm->running = 1; - return 0; } if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) { pcm->running = 0; |