OSDN Git Service

usb audio: Fix incorrect bytes returned for recording
authorPavan Chikkala <pavanc@codeaurora.org>
Fri, 9 Jan 2015 20:21:13 +0000 (12:21 -0800)
committerEric Laurent <elaurent@google.com>
Fri, 9 Jan 2015 22:14:41 +0000 (14:14 -0800)
commit83b47a6891a5bf3d546f0f7a8976132e45169075
treef77950a41f508f9f07b0027d6fef162fc7688f7f
parent781bb3f72e2706f07ee8bcc0c140201faf07c35c
usb audio: Fix incorrect bytes returned for recording

In a recording session , the number of bytes read is
not updated when pcm_read() fails. This results in
silence/invalid data being added during a device switch
from USB headset to handset.
Fix is to reset the number of bytes read if pcm_read()
returns an error indicating removal of USB headset.

Bug: 18611518

Change-Id: I10d578c3cf1037c90a891e63be2bd1c2b7e6126b
modules/usbaudio/audio_hw.c