aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorVolker Rümelin <vr_qemu@t-online.de>2022-03-01 20:12:58 +0100
committerGerd Hoffmann <kraxel@redhat.com>2022-03-04 11:05:13 +0100
commit8e56a172a15708c6b7382fbf3441bed26bc0ffef (patch)
treeb648fb0f1dd3bffdb1b0c5b6a07b7a3b7e0a3ed2 /audio
parent18404ff111e43d218b36b69ae002cae58acef352 (diff)
audio: move function audio_pcm_hw_clip_out()
Move the function audio_pcm_hw_clip_out() into the correct section 'Hard voice (playback)'. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/audio/audio.c b/audio/audio.c
index e7a139e289..dfd32912da 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -548,25 +548,6 @@ static size_t audio_pcm_hw_get_live_in(HWVoiceIn *hw)
return live;
}
-static void audio_pcm_hw_clip_out(HWVoiceOut *hw, void *pcm_buf, size_t len)
-{
- size_t clipped = 0;
- size_t pos = hw->mix_buf->pos;
-
- while (len) {
- st_sample *src = hw->mix_buf->samples + pos;
- uint8_t *dst = advance(pcm_buf, clipped * hw->info.bytes_per_frame);
- size_t samples_till_end_of_buf = hw->mix_buf->size - pos;
- size_t samples_to_clip = MIN(len, samples_till_end_of_buf);
-
- hw->clip(dst, src, samples_to_clip);
-
- pos = (pos + samples_to_clip) % hw->mix_buf->size;
- len -= samples_to_clip;
- clipped += samples_to_clip;
- }
-}
-
/*
* Soft voice (capture)
*/
@@ -677,6 +658,25 @@ static size_t audio_pcm_hw_get_live_out (HWVoiceOut *hw, int *nb_live)
return 0;
}
+static void audio_pcm_hw_clip_out(HWVoiceOut *hw, void *pcm_buf, size_t len)
+{
+ size_t clipped = 0;
+ size_t pos = hw->mix_buf->pos;
+
+ while (len) {
+ st_sample *src = hw->mix_buf->samples + pos;
+ uint8_t *dst = advance(pcm_buf, clipped * hw->info.bytes_per_frame);
+ size_t samples_till_end_of_buf = hw->mix_buf->size - pos;
+ size_t samples_to_clip = MIN(len, samples_till_end_of_buf);
+
+ hw->clip(dst, src, samples_to_clip);
+
+ pos = (pos + samples_to_clip) % hw->mix_buf->size;
+ len -= samples_to_clip;
+ clipped += samples_to_clip;
+ }
+}
+
/*
* Soft voice (playback)
*/