aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-19 21:42:06 +0200
committerMax Kellermann <max@duempel.org>2014-09-19 21:42:06 +0200
commit5921ffaa36483d6c532f9c18db96f2e287b9df81 (patch)
tree62771776ef2319e6661483e03838dadaf08f03c1 /src
parentcf47b68c1eb1603d3777dc86903180d3fe5dd20c (diff)
downloadmpd-5921ffaa36483d6c532f9c18db96f2e287b9df81.tar.gz
mpd-5921ffaa36483d6c532f9c18db96f2e287b9df81.tar.xz
mpd-5921ffaa36483d6c532f9c18db96f2e287b9df81.zip
decoder/sndfile: move sf_readf_int() call to sndfile_read_frames()
Diffstat (limited to 'src')
-rw-r--r--src/decoder/plugins/SndfileDecoderPlugin.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx
index a1a426752..388c2d594 100644
--- a/src/decoder/plugins/SndfileDecoderPlugin.cxx
+++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx
@@ -154,6 +154,12 @@ sndfile_sample_format(const SF_INFO &info)
return SampleFormat::S32;
}
+static sf_count_t
+sndfile_read_frames(SNDFILE *sf, void *buffer, sf_count_t n_frames)
+{
+ return sf_readf_int(sf, (int *)buffer, n_frames);
+}
+
static void
sndfile_stream_decode(Decoder &decoder, InputStream &is)
{
@@ -183,14 +189,16 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is)
decoder_initialized(decoder, audio_format, info.seekable,
sndfile_duration(info));
- int buffer[4096];
+ char buffer[16384];
const size_t frame_size = audio_format.GetFrameSize();
const sf_count_t read_frames = sizeof(buffer) / frame_size;
DecoderCommand cmd;
do {
- sf_count_t num_frames = sf_readf_int(sf, buffer, read_frames);
+ sf_count_t num_frames =
+ sndfile_read_frames(sf,
+ buffer, read_frames);
if (num_frames <= 0)
break;