From 6e3bbe38d595a59909c30c429764ab9afac252fc Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 9 Aug 2013 16:52:25 -0700 Subject: [PATCH] Make audio buffers const. --- src/libguac/audio.c | 4 ++-- src/libguac/guacamole/audio.h | 6 +++--- src/libguac/ogg_encoder.c | 2 +- src/libguac/wav_encoder.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libguac/audio.c b/src/libguac/audio.c index da9ea487..fb8bcd3c 100644 --- a/src/libguac/audio.c +++ b/src/libguac/audio.c @@ -153,7 +153,7 @@ void guac_audio_stream_free(guac_audio_stream* audio) { } void guac_audio_stream_write_pcm(guac_audio_stream* audio, - unsigned char* data, int length) { + const unsigned char* data, int length) { /* Update counter */ audio->pcm_bytes_written += length; @@ -194,7 +194,7 @@ void guac_audio_stream_flush(guac_audio_stream* audio) { } void guac_audio_stream_write_encoded(guac_audio_stream* audio, - unsigned char* data, int length) { + const unsigned char* data, int length) { /* Resize audio buffer if necessary */ if (audio->encoded_data_used + length > audio->encoded_data_length) { diff --git a/src/libguac/guacamole/audio.h b/src/libguac/guacamole/audio.h index 898f543e..a243fa59 100644 --- a/src/libguac/guacamole/audio.h +++ b/src/libguac/guacamole/audio.h @@ -63,7 +63,7 @@ typedef void guac_audio_encoder_end_handler(guac_audio_stream* audio); * Handler which is called when the audio stream is flushed. */ typedef void guac_audio_encoder_write_handler(guac_audio_stream* audio, - unsigned char* pcm_data, int length); + const unsigned char* pcm_data, int length); /** * Arbitrary audio codec encoder. @@ -231,7 +231,7 @@ void guac_audio_stream_end(guac_audio_stream* stream); * @param length The number of bytes of PCM data provided. */ void guac_audio_stream_write_pcm(guac_audio_stream* stream, - unsigned char* data, int length); + const unsigned char* data, int length); /** * Flushes the given audio stream. @@ -251,7 +251,7 @@ void guac_audio_stream_flush(guac_audio_stream* stream); * @param length The number of bytes of data provided. */ void guac_audio_stream_write_encoded(guac_audio_stream* audio, - unsigned char* data, int length); + const unsigned char* data, int length); #endif diff --git a/src/libguac/ogg_encoder.c b/src/libguac/ogg_encoder.c index 25abd7bf..e76b64e4 100644 --- a/src/libguac/ogg_encoder.c +++ b/src/libguac/ogg_encoder.c @@ -164,7 +164,7 @@ void ogg_encoder_end_handler(guac_audio_stream* audio) { } void ogg_encoder_write_handler(guac_audio_stream* audio, - unsigned char* pcm_data, int length) { + const unsigned char* pcm_data, int length) { /* Get state */ ogg_encoder_state* state = (ogg_encoder_state*) audio->data; diff --git a/src/libguac/wav_encoder.c b/src/libguac/wav_encoder.c index 23c9f110..fb7e40e4 100644 --- a/src/libguac/wav_encoder.c +++ b/src/libguac/wav_encoder.c @@ -167,7 +167,7 @@ void wav_encoder_end_handler(guac_audio_stream* audio) { } void wav_encoder_write_handler(guac_audio_stream* audio, - unsigned char* pcm_data, int length) { + const unsigned char* pcm_data, int length) { /* Get state */ wav_encoder_state* state = (wav_encoder_state*) audio->data;