diff options
author | David 'Digit' Turner <digit@android.com> | 2010-12-22 16:55:41 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-01-02 13:14:42 +0100 |
commit | 5164d3c53f57dfb468ab11136358b6e3b6cf0513 (patch) | |
tree | 5f360c835f99ccbf953e80787a0f4f0bfd0d3541 | |
parent | 1306e385222558accba9a01fd93858f06dccf77e (diff) | |
download | external_qemu-5164d3c53f57dfb468ab11136358b6e3b6cf0513.zip external_qemu-5164d3c53f57dfb468ab11136358b6e3b6cf0513.tar.gz external_qemu-5164d3c53f57dfb468ab11136358b6e3b6cf0513.tar.bz2 |
Fix upstream audio bug: can't play with two soft voices.
This patch fixes a problem where using two SWVoiceOut at the same
time would not work, unless the two voices would output sound samples
at the same time.
Change-Id: Id6c6c93f5fe7be29d73776f62fe03732291fcaf9
-rw-r--r-- | audio/audio.c | 4 | ||||
-rw-r--r-- | audio/audio_template.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/audio/audio.c b/audio/audio.c index e095b1a..3e60c12 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1068,7 +1068,7 @@ static int audio_pcm_hw_find_min_out (HWVoiceOut *hw, int *nb_livep) int nb_live = 0; for (sw = hw->sw_head.lh_first; sw; sw = sw->entries.le_next) { - if (sw->active || !sw->empty) { + if (sw->active && !sw->empty) { m = audio_MIN (m, sw->total_hw_samples_mixed); nb_live += 1; } @@ -1540,7 +1540,7 @@ static void audio_run_out (AudioState *s) cleanup_required = 0; for (sw = hw->sw_head.lh_first; sw; sw = sw->entries.le_next) { - if (!sw->active && sw->empty) { + if (!sw->active || sw->empty) { continue; } diff --git a/audio/audio_template.h b/audio/audio_template.h index d3764c8..c0d07e5 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -496,6 +496,9 @@ SW *glue (AUD_open_, TYPE) ( sw->vol = nominal_volume; sw->callback.fn = callback_fn; sw->callback.opaque = callback_opaque; +#ifdef DAC + sw->empty = 1; +#endif #ifdef DAC if (live) { |