diff options
author | Max Kellermann <max@duempel.org> | 2013-08-03 21:00:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-03 21:37:56 +0200 |
commit | d1e7b4e38136f9342aad76c685a13adf0e69f869 (patch) | |
tree | 49643b937ddfe735511b566a71398da5a945d7aa /src/encoder/WaveEncoderPlugin.cxx | |
parent | 67f591a9ce60651da41afc499bd9a22e25314e35 (diff) | |
download | mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip |
audio_format: convert to C++
Diffstat (limited to '')
-rw-r--r-- | src/encoder/WaveEncoderPlugin.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/encoder/WaveEncoderPlugin.cxx b/src/encoder/WaveEncoderPlugin.cxx index 939012d89..cc94247cb 100644 --- a/src/encoder/WaveEncoderPlugin.cxx +++ b/src/encoder/WaveEncoderPlugin.cxx @@ -100,32 +100,32 @@ wave_encoder_finish(Encoder *_encoder) static bool wave_encoder_open(Encoder *_encoder, - gcc_unused struct audio_format *audio_format, + AudioFormat &audio_format, gcc_unused GError **error) { WaveEncoder *encoder = (WaveEncoder *)_encoder; - assert(audio_format_valid(audio_format)); + assert(audio_format.IsValid()); - switch (audio_format->format) { - case SAMPLE_FORMAT_S8: + switch (audio_format.format) { + case SampleFormat::S8: encoder->bits = 8; break; - case SAMPLE_FORMAT_S16: + case SampleFormat::S16: encoder->bits = 16; break; - case SAMPLE_FORMAT_S24_P32: + case SampleFormat::S24_P32: encoder->bits = 24; break; - case SAMPLE_FORMAT_S32: + case SampleFormat::S32: encoder->bits = 32; break; default: - audio_format->format = SAMPLE_FORMAT_S16; + audio_format.format = SampleFormat::S16; encoder->bits = 16; break; } @@ -136,10 +136,10 @@ wave_encoder_open(Encoder *_encoder, /* create PCM wave header in initial buffer */ fill_wave_header(header, - audio_format->channels, + audio_format.channels, encoder->bits, - audio_format->sample_rate, - (encoder->bits / 8) * audio_format->channels ); + audio_format.sample_rate, + (encoder->bits / 8) * audio_format.channels); fifo_buffer_append(encoder->buffer, sizeof(*header)); return true; |