diff options
author | Michael Walle | 2011-01-04 01:48:55 +0100 |
---|---|---|
committer | malc | 2011-01-04 01:53:47 +0100 |
commit | 8a7d0890acd03f45f1d86e12449938891ae18ed9 (patch) | |
tree | 71143c162068e6e08306497fa42f46b4cc0fc6a4 /audio | |
parent | target-arm: Implement correct NaN propagation rules (diff) | |
download | qemu-8a7d0890acd03f45f1d86e12449938891ae18ed9.tar.gz qemu-8a7d0890acd03f45f1d86e12449938891ae18ed9.tar.xz qemu-8a7d0890acd03f45f1d86e12449938891ae18ed9.zip |
noaudio: correctly account acquired samples
This will fix the return value of the function which otherwise returns too
many samples because sw->total_hw_samples_acquired isn't correctly
accounted.
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio')
-rw-r--r-- | audio/noaudio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/noaudio.c b/audio/noaudio.c index 80158583b2..0304094a6e 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -117,9 +117,12 @@ static int no_run_in (HWVoiceIn *hw) static int no_read (SWVoiceIn *sw, void *buf, int size) { + /* use custom code here instead of audio_pcm_sw_read() to avoid + * useless resampling/mixing */ int samples = size >> sw->info.shift; int total = sw->hw->total_samples_captured - sw->total_hw_samples_acquired; int to_clear = audio_MIN (samples, total); + sw->total_hw_samples_acquired += total; audio_pcm_info_clear_buf (&sw->info, buf, to_clear); return to_clear << sw->info.shift; } |