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/PcmDecoderPlugin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/decoder/PcmDecoderPlugin.cxx') diff --git a/src/decoder/PcmDecoderPlugin.cxx b/src/decoder/PcmDecoderPlugin.cxx index f64357e68..8976f511f 100644 --- a/src/decoder/PcmDecoderPlugin.cxx +++ b/src/decoder/PcmDecoderPlugin.cxx @@ -36,9 +36,9 @@ extern "C" { static void pcm_stream_decode(struct decoder *decoder, struct input_stream *is) { - static constexpr struct audio_format audio_format = { + static constexpr AudioFormat audio_format = { 44100, - SAMPLE_FORMAT_S16, + SampleFormat::S16, 2, }; @@ -49,14 +49,14 @@ pcm_stream_decode(struct decoder *decoder, struct input_stream *is) GError *error = nullptr; enum decoder_command cmd; - double time_to_size = audio_format_time_to_size(&audio_format); + const double time_to_size = audio_format.GetTimeToSize(); float total_time = -1; const goffset size = input_stream_get_size(is); if (size >= 0) total_time = size / time_to_size; - decoder_initialized(decoder, &audio_format, + decoder_initialized(decoder, audio_format, input_stream_is_seekable(is), total_time); do { -- cgit v1.2.3