decoder/sndfile: add sndfile_sample_format()
Prepare for other sample formats.
This commit is contained in:
parent
eeb8d0dbcd
commit
cf47b68c1e
@ -146,6 +146,14 @@ sndfile_duration(const SF_INFO &info)
|
|||||||
return SongTime::FromScale<uint64_t>(info.frames, info.samplerate);
|
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
|
static void
|
||||||
sndfile_stream_decode(Decoder &decoder, InputStream &is)
|
sndfile_stream_decode(Decoder &decoder, InputStream &is)
|
||||||
{
|
{
|
||||||
@ -166,7 +174,7 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is)
|
|||||||
Error error;
|
Error error;
|
||||||
AudioFormat audio_format;
|
AudioFormat audio_format;
|
||||||
if (!audio_format_init_checked(audio_format, info.samplerate,
|
if (!audio_format_init_checked(audio_format, info.samplerate,
|
||||||
SampleFormat::S32,
|
sndfile_sample_format(info),
|
||||||
info.channels, error)) {
|
info.channels, error)) {
|
||||||
LogError(error);
|
LogError(error);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user