From d1e7b4e38136f9342aad76c685a13adf0e69f869 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Aug 2013 21:00:50 +0200 Subject: audio_format: convert to C++ --- src/encoder/TwolameEncoderPlugin.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/encoder/TwolameEncoderPlugin.cxx') 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 @@ -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, -- cgit v1.2.3