const pointers in audio.c
git-svn-id: https://svn.musicpd.org/mpd/trunk@7344 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
ac0ac9d4d8
commit
b4ea6e52b2
10
src/audio.c
10
src/audio.c
@ -64,7 +64,7 @@ unsigned int audio_device_count(void)
|
|||||||
return nr;
|
return nr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void copyAudioFormat(AudioFormat * dest, AudioFormat * src)
|
void copyAudioFormat(AudioFormat * dest, const AudioFormat * src)
|
||||||
{
|
{
|
||||||
if (!src)
|
if (!src)
|
||||||
return;
|
return;
|
||||||
@ -72,7 +72,7 @@ void copyAudioFormat(AudioFormat * dest, AudioFormat * src)
|
|||||||
memcpy(dest, src, sizeof(AudioFormat));
|
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) &&
|
if (f1 && f2 && (f1->sampleRate == f2->sampleRate) &&
|
||||||
(f1->bits == f2->bits) && (f1->channels == f2->channels))
|
(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)
|
AudioFormat * outAudioFormat)
|
||||||
{
|
{
|
||||||
if (audio_configFormat) {
|
if (audio_configFormat) {
|
||||||
@ -251,7 +251,7 @@ void finishAudioDriver(void)
|
|||||||
audioOutputArraySize = 0;
|
audioOutputArraySize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isCurrentAudioFormat(AudioFormat * audioFormat)
|
int isCurrentAudioFormat(const AudioFormat * audioFormat)
|
||||||
{
|
{
|
||||||
if (!audioFormat)
|
if (!audioFormat)
|
||||||
return 1;
|
return 1;
|
||||||
@ -319,7 +319,7 @@ static int flushAudioBuffer(void)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int openAudioDevice(AudioFormat * audioFormat)
|
int openAudioDevice(const AudioFormat * audioFormat)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
11
src/audio.h
11
src/audio.h
@ -38,11 +38,12 @@ static inline double audioFormatSizeToTime(const AudioFormat * af)
|
|||||||
return 8.0 / af->bits / af->channels / af->sampleRate;
|
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);
|
int parseAudioConfig(AudioFormat * audioFormat, char *conf);
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ void initAudioDriver(void);
|
|||||||
|
|
||||||
void finishAudioDriver(void);
|
void finishAudioDriver(void);
|
||||||
|
|
||||||
int openAudioDevice(AudioFormat * audioFormat);
|
int openAudioDevice(const AudioFormat * audioFormat);
|
||||||
|
|
||||||
int playAudio(const char *playChunk, size_t size);
|
int playAudio(const char *playChunk, size_t size);
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ void closeAudioDevice(void);
|
|||||||
|
|
||||||
int isAudioDeviceOpen(void);
|
int isAudioDeviceOpen(void);
|
||||||
|
|
||||||
int isCurrentAudioFormat(AudioFormat * audioFormat);
|
int isCurrentAudioFormat(const AudioFormat * audioFormat);
|
||||||
|
|
||||||
void sendMetadataToAudioDevice(MpdTag * tag);
|
void sendMetadataToAudioDevice(MpdTag * tag);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user