audio: Let capture_callback handler use const buffer argument
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 5 May 2020 13:25:58 +0000 (15:25 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 26 May 2020 06:29:39 +0000 (08:29 +0200)
The buffer is the captured input to pass to backends.
As we should not modify it, mark the argument const.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200505132603.8575-3-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
audio/audio.h
audio/wavcapture.c
ui/vnc.c

index f27a12298fe51c433c5e486770379c851950c1dd..b883ebfb1f8ef1d9c5130c2e1cd40fd6b2a646f0 100644 (file)
@@ -60,7 +60,7 @@ typedef enum {
 
 struct audio_capture_ops {
     void (*notify) (void *opaque, audcnotification_e cmd);
-    void (*capture) (void *opaque, void *buf, int size);
+    void (*capture) (void *opaque, const void *buf, int size);
     void (*destroy) (void *opaque);
 };
 
index 8d7ce2eda14569b07022ff95626bd0945366945d..17e87ed6f45eecbf817faed4692434ad2a88c637 100644 (file)
@@ -71,7 +71,7 @@ static void wav_destroy (void *opaque)
     g_free (wav->path);
 }
 
-static void wav_capture (void *opaque, void *buf, int size)
+static void wav_capture(void *opaque, const void *buf, int size)
 {
     WAVState *wav = opaque;
 
index 1d7138a3a073db5b463c67c4e294b339030c76ba..12a12714e129c64e252eb2a55153a11b95e1b5c4 100644 (file)
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1177,7 +1177,7 @@ static void audio_capture_destroy(void *opaque)
 {
 }
 
-static void audio_capture(void *opaque, void *buf, int size)
+static void audio_capture(void *opaque, const void *buf, int size)
 {
     VncState *vs = opaque;