diff options
author | Max Kellermann <max@duempel.org> | 2008-04-12 04:21:39 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-04-12 04:21:39 +0000 |
commit | b4ea6e52b2eba41121431ea6a1569aff04dad8fd (patch) | |
tree | caa7a0f42f921be923cb3807a30901914132bb33 /src | |
parent | ac0ac9d4d8fac451f5dc12c6bdcfaf41c134c632 (diff) | |
download | mpd-b4ea6e52b2eba41121431ea6a1569aff04dad8fd.tar.gz mpd-b4ea6e52b2eba41121431ea6a1569aff04dad8fd.tar.xz mpd-b4ea6e52b2eba41121431ea6a1569aff04dad8fd.zip |
const pointers in audio.c
git-svn-id: https://svn.musicpd.org/mpd/trunk@7344 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r-- | src/audio.c | 10 | ||||
-rw-r--r-- | src/audio.h | 11 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/audio.c b/src/audio.c index 1e4c70cbc..3c5ef4478 100644 --- a/src/audio.c +++ b/src/audio.c @@ -64,7 +64,7 @@ unsigned int audio_device_count(void) return nr; } -void copyAudioFormat(AudioFormat * dest, AudioFormat * src) +void copyAudioFormat(AudioFormat * dest, const AudioFormat * src) { if (!src) return; @@ -72,7 +72,7 @@ void copyAudioFormat(AudioFormat * dest, AudioFormat * src) memcpy(dest, src, sizeof(AudioFormat)); } -int cmpAudioFormat(AudioFormat * f1, AudioFormat * f2) +int cmpAudioFormat(const AudioFormat * f1, const AudioFormat * f2) { if (f1 && f2 && (f1->sampleRate == f2->sampleRate) && (f1->bits == f2->bits) && (f1->channels == f2->channels)) @@ -141,7 +141,7 @@ void initAudioDriver(void) } } -void getOutputAudioFormat(AudioFormat * inAudioFormat, +void getOutputAudioFormat(const AudioFormat * inAudioFormat, AudioFormat * outAudioFormat) { if (audio_configFormat) { @@ -251,7 +251,7 @@ void finishAudioDriver(void) audioOutputArraySize = 0; } -int isCurrentAudioFormat(AudioFormat * audioFormat) +int isCurrentAudioFormat(const AudioFormat * audioFormat) { if (!audioFormat) return 1; @@ -319,7 +319,7 @@ static int flushAudioBuffer(void) return ret; } -int openAudioDevice(AudioFormat * audioFormat) +int openAudioDevice(const AudioFormat * audioFormat) { int ret = -1; unsigned int i; diff --git a/src/audio.h b/src/audio.h index f8b28d0d0..71d79ec84 100644 --- a/src/audio.h +++ b/src/audio.h @@ -38,11 +38,12 @@ static inline double audioFormatSizeToTime(const AudioFormat * af) return 8.0 / af->bits / af->channels / af->sampleRate; } -void copyAudioFormat(AudioFormat * dest, AudioFormat * src); +void copyAudioFormat(AudioFormat * dest, const AudioFormat * src); -int cmpAudioFormat(AudioFormat * dest, AudioFormat * src); +int cmpAudioFormat(const AudioFormat * dest, const AudioFormat * src); -void getOutputAudioFormat(AudioFormat * inFormat, AudioFormat * outFormat); +void getOutputAudioFormat(const AudioFormat * inFormat, + AudioFormat * outFormat); int parseAudioConfig(AudioFormat * audioFormat, char *conf); @@ -55,7 +56,7 @@ void initAudioDriver(void); void finishAudioDriver(void); -int openAudioDevice(AudioFormat * audioFormat); +int openAudioDevice(const AudioFormat * audioFormat); int playAudio(const char *playChunk, size_t size); @@ -65,7 +66,7 @@ void closeAudioDevice(void); int isAudioDeviceOpen(void); -int isCurrentAudioFormat(AudioFormat * audioFormat); +int isCurrentAudioFormat(const AudioFormat * audioFormat); void sendMetadataToAudioDevice(MpdTag * tag); |