summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2018-08-11 21:27:59 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2018-08-11 21:47:26 -0300
commiteb3ab7cbbd49f2ac844790e442ba772ca09eb7ed (patch)
tree6f8d8210fac87c3e7a776de35be6459a7124326a
parent64595f0f6ad2aab38fb14f85c077c6e147326624 (diff)
Fix compile error with PulseAudio driver and clang
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 987cd9c85f..d1104eec18 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -349,7 +349,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
}
uint32_t l = ad->samples_in[in_idx++];
uint32_t r = ad->samples_in[in_idx++];
- ad->samples_out.write[out_idx++] = (l >> 1 + r >> 1) >> 16;
+ ad->samples_out.write[out_idx++] = ((l >> 1) + (r >> 1)) >> 16;
}
}
}
@@ -373,7 +373,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
if (bytes > 0) {
size_t bytes_to_write = MIN(bytes, avail_bytes);
const void *ptr = ad->samples_out.ptr();
- ret = pa_stream_write(ad->pa_str, ptr + write_ofs, bytes_to_write, NULL, 0LL, PA_SEEK_RELATIVE);
+ ret = pa_stream_write(ad->pa_str, (char *)ptr + write_ofs, bytes_to_write, NULL, 0LL, PA_SEEK_RELATIVE);
if (ret != 0) {
ERR_PRINT("pa_stream_write error");
} else {