aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/VorbisDecoderPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/plugins/VorbisDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/VorbisDecoderPlugin.cxx18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/decoder/plugins/VorbisDecoderPlugin.cxx b/src/decoder/plugins/VorbisDecoderPlugin.cxx
index e0d3d1374..d7069a2f4 100644
--- a/src/decoder/plugins/VorbisDecoderPlugin.cxx
+++ b/src/decoder/plugins/VorbisDecoderPlugin.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -24,6 +24,7 @@
#include "../DecoderAPI.hxx"
#include "input/InputStream.hxx"
#include "OggCodec.hxx"
+#include "pcm/Interleave.hxx"
#include "util/Error.hxx"
#include "util/Macros.hxx"
#include "CheckAudioFormat.hxx"
@@ -181,20 +182,15 @@ static void
vorbis_interleave(float *dest, const float *const*src,
unsigned nframes, unsigned channels)
{
- for (const float *const*src_end = src + channels;
- src != src_end; ++src, ++dest) {
- float *gcc_restrict d = dest;
- for (const float *gcc_restrict s = *src, *s_end = s + nframes;
- s != s_end; ++s, d += channels)
- *d = *s;
- }
+ PcmInterleaveFloat(dest, ConstBuffer<const float *>(src, channels),
+ nframes);
}
#endif
/* public */
static bool
-vorbis_init(gcc_unused const config_param &param)
+vorbis_init(gcc_unused const ConfigBlock &block)
{
#ifndef HAVE_TREMOR
LogDebug(vorbis_domain, vorbis_version_string());
@@ -263,7 +259,7 @@ vorbis_stream_decode(Decoder &decoder,
unsigned kbit_rate = 0;
DecoderCommand cmd = decoder_get_command(decoder);
- do {
+ while (cmd != DecoderCommand::STOP) {
if (cmd == DecoderCommand::SEEK) {
auto seek_where = decoder_seek_where_frame(decoder);
if (0 == ov_pcm_seek_page(&vf, seek_where)) {
@@ -332,7 +328,7 @@ vorbis_stream_decode(Decoder &decoder,
cmd = decoder_data(decoder, input_stream,
buffer, nbytes,
kbit_rate);
- } while (cmd != DecoderCommand::STOP);
+ }
ov_clear(&vf);
}