aboutsummaryrefslogtreecommitdiffstats
path: root/src/encoder/VorbisEncoderPlugin.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/VorbisEncoderPlugin.cxx
parent67f591a9ce60651da41afc499bd9a22e25314e35 (diff)
downloadmpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip
audio_format: convert to C++
Diffstat (limited to 'src/encoder/VorbisEncoderPlugin.cxx')
-rw-r--r--src/encoder/VorbisEncoderPlugin.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/encoder/VorbisEncoderPlugin.cxx b/src/encoder/VorbisEncoderPlugin.cxx
index 1fc9bde67..bc43ffa43 100644
--- a/src/encoder/VorbisEncoderPlugin.cxx
+++ b/src/encoder/VorbisEncoderPlugin.cxx
@@ -22,7 +22,7 @@
#include "OggStream.hxx"
#include "EncoderAPI.hxx"
#include "Tag.hxx"
-#include "audio_format.h"
+#include "AudioFormat.hxx"
#include "mpd_error.h"
#include <vorbis/vorbisenc.h>
@@ -43,7 +43,7 @@ struct vorbis_encoder {
/* runtime information */
- struct audio_format audio_format;
+ AudioFormat audio_format;
vorbis_dsp_state vd;
vorbis_block vb;
@@ -202,14 +202,14 @@ vorbis_encoder_send_header(struct vorbis_encoder *encoder)
static bool
vorbis_encoder_open(Encoder *_encoder,
- struct audio_format *audio_format,
+ AudioFormat &audio_format,
GError **error)
{
struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder;
- audio_format->format = SAMPLE_FORMAT_FLOAT;
+ audio_format.format = SampleFormat::FLOAT;
- encoder->audio_format = *audio_format;
+ encoder->audio_format = audio_format;
if (!vorbis_encoder_reinit(encoder, error))
return false;
@@ -328,8 +328,7 @@ vorbis_encoder_write(Encoder *_encoder,
{
struct vorbis_encoder *encoder = (struct vorbis_encoder *)_encoder;
- unsigned num_frames = length
- / audio_format_frame_size(&encoder->audio_format);
+ unsigned num_frames = length / encoder->audio_format.GetFrameSize();
/* this is for only 16-bit audio */