aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;
}