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/decoder/OpusDecoderPlugin.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/decoder/OpusDecoderPlugin.cxx') diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx index 08c67b570..94c687317 100644 --- a/src/decoder/OpusDecoderPlugin.cxx +++ b/src/decoder/OpusDecoderPlugin.cxx @@ -202,11 +202,10 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet) return DECODE_COMMAND_STOP; } - struct audio_format audio_format; - audio_format_init(&audio_format, opus_sample_rate, - SAMPLE_FORMAT_S16, channels); - decoder_initialized(decoder, &audio_format, false, -1); - frame_size = audio_format_frame_size(&audio_format); + const AudioFormat audio_format(opus_sample_rate, + SampleFormat::S16, channels); + decoder_initialized(decoder, audio_format, false, -1); + frame_size = audio_format.GetFrameSize(); /* allocate an output buffer for 16 bit PCM samples big enough to hold a quarter second, larger than 120ms required by -- cgit v1.2.3