noaudio: fix return value for read()

Submitted by Michael Walle on Dec. 8, 2010, 11:34 p.m.

Details

Message ID 1291851291-17542-1-git-send-email-michael@walle.cc
State New
Headers show

Commit Message

Michael Walle Dec. 8, 2010, 11:34 p.m.
Read should return bytes instead of samples.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 audio/noaudio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

malc Dec. 10, 2010, 2:29 a.m.
On Thu, 9 Dec 2010, Michael Walle wrote:

> Read should return bytes instead of samples.

Thanks, applied.

[..snip..]

Patch hide | download patch | download mbox

diff --git a/audio/noaudio.c b/audio/noaudio.c
index 4925234..8015858 100644
--- a/audio/noaudio.c
+++ b/audio/noaudio.c
@@ -121,7 +121,7 @@  static int no_read (SWVoiceIn *sw, void *buf, int size)
     int total = sw->hw->total_samples_captured - sw->total_hw_samples_acquired;
     int to_clear = audio_MIN (samples, total);
     audio_pcm_info_clear_buf (&sw->info, buf, to_clear);
-    return to_clear;
+    return to_clear << sw->info.shift;
 }
 
 static int no_ctl_in (HWVoiceIn *hw, int cmd, ...)