aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-02 17:05:27 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-02 17:05:27 +0000
commitee5d5d633016948f3ecf2d5f9875d7e8223f9a36 (patch)
treeeb58a5f4ed032e6f28ff0e7f5bdaae29dd937e38 /src/audio.c
parent02982397700a02cb095970023ff9e8618638cc0c (diff)
downloadmpd-ee5d5d633016948f3ecf2d5f9875d7e8223f9a36.tar.gz
mpd-ee5d5d633016948f3ecf2d5f9875d7e8223f9a36.tar.xz
mpd-ee5d5d633016948f3ecf2d5f9875d7e8223f9a36.zip
abstract out audioFormat conversion from shout plugin to the audioOutput layer,
now format can be specified for each different audioOutput device git-svn-id: https://svn.musicpd.org/mpd/trunk@2474 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/audio.c b/src/audio.c
index 0dd1469b1..c8ece7a90 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -34,9 +34,11 @@ static AudioFormat * audio_configFormat = NULL;
void copyAudioFormat(AudioFormat * dest, AudioFormat * src) {
if(!src) return;
- dest->sampleRate = src->sampleRate;
- dest->bits = src->bits;
- dest->channels = src->channels;
+ memcpy(dest, src, sizeof(AudioFormat));
+}
+
+int cmpAudioFormat(AudioFormat * f1, AudioFormat * f2) {
+ return memcmp(f1, f2, sizeof(AudioFormat));
}
static AudioOutput ** audioOutputArray = NULL;
@@ -179,7 +181,7 @@ void finishAudioDriver() {
int isCurrentAudioFormat(AudioFormat * audioFormat) {
if(!audioFormat) return 1;
- if(memcmp(audioFormat,&audio_format,sizeof(AudioFormat)) != 0) return 0;
+ if(cmpAudioFormat(audioFormat, &audio_format) != 0) return 0;
return 1;
}