aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputAll.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-03 21:00:50 +0200
committerMax Kellermann <max@duempel.org>2013-08-03 21:37:56 +0200
commitd1e7b4e38136f9342aad76c685a13adf0e69f869 (patch)
tree49643b937ddfe735511b566a71398da5a945d7aa /src/OutputAll.cxx
parent67f591a9ce60651da41afc499bd9a22e25314e35 (diff)
downloadmpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip
audio_format: convert to C++
Diffstat (limited to '')
-rw-r--r--src/OutputAll.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/OutputAll.cxx b/src/OutputAll.cxx
index cdbdcfbfc..a73afbbb6 100644
--- a/src/OutputAll.cxx
+++ b/src/OutputAll.cxx
@@ -36,7 +36,7 @@
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "output"
-static struct audio_format input_audio_format;
+static AudioFormat input_audio_format;
static struct audio_output **audio_outputs;
static unsigned int num_audio_outputs;
@@ -246,12 +246,12 @@ audio_output_all_update(void)
unsigned int i;
bool ret = false;
- if (!audio_format_defined(&input_audio_format))
+ if (!input_audio_format.IsDefined())
return false;
for (i = 0; i < num_audio_outputs; ++i)
ret = audio_output_update(audio_outputs[i],
- &input_audio_format, g_mp) || ret;
+ input_audio_format, g_mp) || ret;
return ret;
}
@@ -291,14 +291,13 @@ audio_output_all_play(struct music_chunk *chunk, GError **error_r)
}
bool
-audio_output_all_open(const struct audio_format *audio_format,
+audio_output_all_open(const AudioFormat audio_format,
struct music_buffer *buffer,
GError **error_r)
{
bool ret = false, enabled = false;
unsigned int i;
- assert(audio_format != NULL);
assert(buffer != NULL);
assert(g_music_buffer == NULL || g_music_buffer == buffer);
assert((g_mp == NULL) == (g_music_buffer == NULL));
@@ -315,10 +314,9 @@ audio_output_all_open(const struct audio_format *audio_format,
/* if the pipe hasn't been cleared, the the audio
format must not have changed */
assert(music_pipe_empty(g_mp) ||
- audio_format_equals(audio_format,
- &input_audio_format));
+ audio_format == input_audio_format);
- input_audio_format = *audio_format;
+ input_audio_format = audio_format;
audio_output_all_reset_reopen();
audio_output_all_enable_disable();
@@ -547,7 +545,7 @@ audio_output_all_close(void)
g_music_buffer = NULL;
- audio_format_clear(&input_audio_format);
+ input_audio_format.Clear();
audio_output_all_elapsed_time = -1.0;
}
@@ -570,7 +568,7 @@ audio_output_all_release(void)
g_music_buffer = NULL;
- audio_format_clear(&input_audio_format);
+ input_audio_format.Clear();
audio_output_all_elapsed_time = -1.0;
}