diff options
author | Yu Ning <yu.ning@intel.com> | 2015-03-31 15:03:47 +0800 |
---|---|---|
committer | Yu Ning <yu.ning@intel.com> | 2015-03-31 15:03:47 +0800 |
commit | dd3defba2032e3e9c97cd2e95963fc2d98c7ffd7 (patch) | |
tree | 990a0d9f52951889079468fe42ac840b97afcd34 | |
parent | 055e9546a4a6d86654b99b13177dbba909412d77 (diff) | |
download | qemu-android-dd3defba2032e3e9c97cd2e95963fc2d98c7ffd7.tar.gz |
goldfish_audio: Fix updating of status bits for output buffers
AUDIO_INT_WRITE_BUFFER_i_EMPTY (i = 1, 2) should be set whenever output
buffer i becomes empty (i.e. ready to receive new data). However, the
current code in goldfish_audio_flush() does not do that correctly. Fix
that logic to enable audio playback.
Change-Id: I40ac9cf7736c64049f8bcbd491dab7d9ab88c3d9
Signed-off-by: Yu Ning <yu.ning@intel.com>
-rw-r--r-- | hw/audio/goldfish_audio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/audio/goldfish_audio.c b/hw/audio/goldfish_audio.c index 2bd5d835a7..b25e38a747 100644 --- a/hw/audio/goldfish_audio.c +++ b/hw/audio/goldfish_audio.c @@ -344,9 +344,10 @@ static bool goldfish_audio_flush(struct goldfish_audio_state *s, int buf, *free -= written; trace_goldfish_audio_buff_send(written, buf + 1); - if (!goldfish_audio_buff_length(b) == 0) - *new_status |= buf ? AUDIO_INT_WRITE_BUFFER_1_EMPTY : - AUDIO_INT_WRITE_BUFFER_2_EMPTY; + /* If buffer is drained, set corresponding status bit. */ + if (!goldfish_audio_buff_length(b)) + *new_status |= buf ? AUDIO_INT_WRITE_BUFFER_2_EMPTY : + AUDIO_INT_WRITE_BUFFER_1_EMPTY; return true; } |