Commit bc79ecdc authored by Stefan Westerfeld's avatar Stefan Westerfeld

SFInputStream: fixes related to number of frames.

 - use size_t for n_frames -> support larger files
 - map SF_COUNT_MAX to unknown length
Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent f40ebe33
......@@ -68,7 +68,7 @@ SFInputStream::open (std::function<SNDFILE* (SF_INFO *)> open_func)
}
m_n_channels = sfinfo.channels;
m_n_values = sfinfo.frames * sfinfo.channels;
m_n_frames = (sfinfo.frames == SF_COUNT_MAX) ? N_FRAMES_UNKNOWN : sfinfo.frames;
m_sample_rate = sfinfo.samplerate;
switch (sfinfo.format & SF_FORMAT_SUBMASK)
......
......@@ -42,7 +42,7 @@ private:
SNDFILE *m_sndfile = nullptr;
int m_n_channels = 0;
int m_n_values = 0;
size_t m_n_frames = 0;
int m_bit_depth = 0;
int m_sample_rate = 0;
bool m_read_float_data = false;
......@@ -74,7 +74,7 @@ public:
size_t
n_frames() const override
{
return m_n_values / m_n_channels;
return m_n_frames;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment