aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoder/TwolameEncoderPlugin.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/encoder/TwolameEncoderPlugin.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/encoder/TwolameEncoderPlugin.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/encoder/TwolameEncoderPlugin.cxx b/src/encoder/TwolameEncoderPlugin.cxx
index c307b7b4f..4e2d47b63 100644
--- a/src/encoder/TwolameEncoderPlugin.cxx
+++ b/src/encoder/TwolameEncoderPlugin.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "TwolameEncoderPlugin.hxx"
#include "EncoderAPI.hxx"
-#include "audio_format.h"
+#include "AudioFormat.hxx"
#include <twolame.h>
@@ -32,7 +32,7 @@
struct TwolameEncoder final {
Encoder encoder;
- struct audio_format audio_format;
+ AudioFormat audio_format;
float quality;
int bitrate;
@@ -187,15 +187,15 @@ twolame_encoder_setup(TwolameEncoder *encoder, GError **error)
}
static bool
-twolame_encoder_open(Encoder *_encoder, struct audio_format *audio_format,
+twolame_encoder_open(Encoder *_encoder, AudioFormat &audio_format,
GError **error)
{
TwolameEncoder *encoder = (TwolameEncoder *)_encoder;
- audio_format->format = SAMPLE_FORMAT_S16;
- audio_format->channels = 2;
+ audio_format.format = SampleFormat::S16;
+ audio_format.channels = 2;
- encoder->audio_format = *audio_format;
+ encoder->audio_format = audio_format;
encoder->options = twolame_init();
if (encoder->options == nullptr) {
@@ -243,7 +243,7 @@ twolame_encoder_write(Encoder *_encoder,
assert(encoder->buffer_length == 0);
const unsigned num_frames =
- length / audio_format_frame_size(&encoder->audio_format);
+ length / encoder->audio_format.GetFrameSize();
int bytes_out = twolame_encode_buffer_interleaved(encoder->options,
src, num_frames,