aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-08-19 01:06:54 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-08-21 09:13:37 +0200
commit589359150365616de479866f8bc594c876480bd8 (patch)
tree3b0413edced2698cd97e18b6cc106df811c0cc2c /audio/audio.c
parent8692bf7d978aee2329d9449e31043451a8fdb357 (diff)
audio: remove audio_MIN, audio_MAX
There's already a MIN and MAX macro in include/qemu/osdep.h, use them instead. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 303222477df6f7373217e0df768635fab5855745.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/audio/audio.c b/audio/audio.c
index c99e4ddea4..38267695f7 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -535,7 +535,7 @@ static int audio_pcm_hw_find_min_in (HWVoiceIn *hw)
for (sw = hw->sw_head.lh_first; sw; sw = sw->entries.le_next) {
if (sw->active) {
- m = audio_MIN (m, sw->total_hw_samples_acquired);
+ m = MIN (m, sw->total_hw_samples_acquired);
}
}
return m;
@@ -555,14 +555,14 @@ int audio_pcm_hw_clip_out (HWVoiceOut *hw, void *pcm_buf,
int live, int pending)
{
int left = hw->samples - pending;
- int len = audio_MIN (left, live);
+ int len = MIN (left, live);
int clipped = 0;
while (len) {
struct st_sample *src = hw->mix_buf + hw->rpos;
uint8_t *dst = advance (pcm_buf, hw->rpos << hw->info.shift);
int samples_till_end_of_buf = hw->samples - hw->rpos;
- int samples_to_clip = audio_MIN (len, samples_till_end_of_buf);
+ int samples_to_clip = MIN (len, samples_till_end_of_buf);
hw->clip (dst, src, samples_to_clip);
@@ -616,7 +616,7 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int size)
}
swlim = (live * sw->ratio) >> 32;
- swlim = audio_MIN (swlim, samples);
+ swlim = MIN (swlim, samples);
while (swlim) {
src = hw->conv_buf + rpos;
@@ -664,7 +664,7 @@ static int audio_pcm_hw_find_min_out (HWVoiceOut *hw, int *nb_livep)
for (sw = hw->sw_head.lh_first; sw; sw = sw->entries.le_next) {
if (sw->active || !sw->empty) {
- m = audio_MIN (m, sw->total_hw_samples_mixed);
+ m = MIN (m, sw->total_hw_samples_mixed);
nb_live += 1;
}
}
@@ -727,7 +727,7 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int size)
dead = hwsamples - live;
swlim = ((int64_t) dead << 32) / sw->ratio;
- swlim = audio_MIN (swlim, samples);
+ swlim = MIN (swlim, samples);
if (swlim) {
sw->conv (sw->buf, buf, swlim);
@@ -739,7 +739,7 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int size)
while (swlim) {
dead = hwsamples - live;
left = hwsamples - wpos;
- blck = audio_MIN (dead, left);
+ blck = MIN (dead, left);
if (!blck) {
break;
}
@@ -1031,7 +1031,7 @@ static void audio_capture_mix_and_clear (HWVoiceOut *hw, int rpos, int samples)
n = samples;
while (n) {
int till_end_of_hw = hw->samples - rpos2;
- int to_write = audio_MIN (till_end_of_hw, n);
+ int to_write = MIN (till_end_of_hw, n);
int bytes = to_write << hw->info.shift;
int written;
@@ -1049,7 +1049,7 @@ static void audio_capture_mix_and_clear (HWVoiceOut *hw, int rpos, int samples)
}
}
- n = audio_MIN (samples, hw->samples - rpos);
+ n = MIN (samples, hw->samples - rpos);
mixeng_clear (hw->mix_buf + rpos, n);
mixeng_clear (hw->mix_buf, samples - n);
}
@@ -1205,7 +1205,7 @@ static void audio_run_capture (AudioState *s)
rpos = hw->rpos;
while (live) {
int left = hw->samples - rpos;
- int to_capture = audio_MIN (live, left);
+ int to_capture = MIN (live, left);
struct st_sample *src;
struct capture_callback *cb;