aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-19 21:06:44 +0200
committerMax Kellermann <max@duempel.org>2014-09-19 21:06:44 +0200
commitcf47b68c1eb1603d3777dc86903180d3fe5dd20c (patch)
treecb751b9c9f5e898f6b337da2f94400192ca6fcc1 /src/decoder/plugins
parenteeb8d0dbcdc213a430ce00057da061a86804fc7b (diff)
downloadmpd-cf47b68c1eb1603d3777dc86903180d3fe5dd20c.tar.gz
mpd-cf47b68c1eb1603d3777dc86903180d3fe5dd20c.tar.xz
mpd-cf47b68c1eb1603d3777dc86903180d3fe5dd20c.zip
decoder/sndfile: add sndfile_sample_format()
Prepare for other sample formats.
Diffstat (limited to 'src/decoder/plugins')
-rw-r--r--src/decoder/plugins/SndfileDecoderPlugin.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx
index 6adba02cc..a1a426752 100644
--- a/src/decoder/plugins/SndfileDecoderPlugin.cxx
+++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx
@@ -146,6 +146,14 @@ sndfile_duration(const SF_INFO &info)
return SongTime::FromScale<uint64_t>(info.frames, info.samplerate);
}
+gcc_pure
+static SampleFormat
+sndfile_sample_format(const SF_INFO &info)
+{
+ (void)info;
+ return SampleFormat::S32;
+}
+
static void
sndfile_stream_decode(Decoder &decoder, InputStream &is)
{
@@ -166,7 +174,7 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is)
Error error;
AudioFormat audio_format;
if (!audio_format_init_checked(audio_format, info.samplerate,
- SampleFormat::S32,
+ sndfile_sample_format(info),
info.channels, error)) {
LogError(error);
return;