Commit 3d5b1d71 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Remove unused n_frames argument from SFOutputStream::open().

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 14c6f9f0
...@@ -89,7 +89,7 @@ AudioOutputStream::create (const string& filename, int n_channels, int sample_ra ...@@ -89,7 +89,7 @@ AudioOutputStream::create (const string& filename, int n_channels, int sample_ra
{ {
SFOutputStream *sfostream = new SFOutputStream(); SFOutputStream *sfostream = new SFOutputStream();
out_stream.reset (sfostream); out_stream.reset (sfostream);
err = sfostream->open (filename, n_channels, sample_rate, bit_depth, n_frames); err = sfostream->open (filename, n_channels, sample_rate, bit_depth);
if (err) if (err)
return nullptr; return nullptr;
} }
......
...@@ -30,15 +30,15 @@ SFOutputStream::~SFOutputStream() ...@@ -30,15 +30,15 @@ SFOutputStream::~SFOutputStream()
} }
Error Error
SFOutputStream::open (const string& filename, int n_channels, int sample_rate, int bit_depth, size_t n_frames) SFOutputStream::open (const string& filename, int n_channels, int sample_rate, int bit_depth)
{ {
return open ([&] (SF_INFO *sfinfo) { return open ([&] (SF_INFO *sfinfo) {
return sf_open (filename.c_str(), SFM_WRITE, sfinfo); return sf_open (filename.c_str(), SFM_WRITE, sfinfo);
}, n_channels, sample_rate, bit_depth, n_frames); }, n_channels, sample_rate, bit_depth);
} }
Error Error
SFOutputStream::open (std::function<SNDFILE* (SF_INFO *)> open_func, int n_channels, int sample_rate, int bit_depth, size_t n_frames) SFOutputStream::open (std::function<SNDFILE* (SF_INFO *)> open_func, int n_channels, int sample_rate, int bit_depth)
{ {
assert (m_state == State::NEW); assert (m_state == State::NEW);
...@@ -132,11 +132,11 @@ SFOutputStream::n_channels() const ...@@ -132,11 +132,11 @@ SFOutputStream::n_channels() const
} }
Error Error
SFOutputStream::open (vector<unsigned char> *data, int n_channels, int sample_rate, int bit_depth, size_t n_frames) SFOutputStream::open (vector<unsigned char> *data, int n_channels, int sample_rate, int bit_depth)
{ {
m_virtual_data.mem = data; m_virtual_data.mem = data;
return open ([&] (SF_INFO *sfinfo) { return open ([&] (SF_INFO *sfinfo) {
return sf_open_virtual (&m_virtual_data.io, SFM_WRITE, sfinfo, &m_virtual_data); return sf_open_virtual (&m_virtual_data.io, SFM_WRITE, sfinfo, &m_virtual_data);
}, n_channels, sample_rate, bit_depth, n_frames); }, n_channels, sample_rate, bit_depth);
} }
...@@ -41,12 +41,12 @@ class SFOutputStream : public AudioOutputStream ...@@ -41,12 +41,12 @@ class SFOutputStream : public AudioOutputStream
}; };
State m_state = State::NEW; State m_state = State::NEW;
Error open (std::function<SNDFILE* (SF_INFO *)> open_func, int n_channels, int sample_rate, int bit_depth, size_t n_frames); Error open (std::function<SNDFILE* (SF_INFO *)> open_func, int n_channels, int sample_rate, int bit_depth);
public: public:
~SFOutputStream(); ~SFOutputStream();
Error open (const std::string& filename, int n_channels, int sample_rate, int bit_depth, size_t n_frames); Error open (const std::string& filename, int n_channels, int sample_rate, int bit_depth);
Error open (std::vector<unsigned char> *data, int n_channels, int sample_rate, int bit_depth, size_t n_frames); Error open (std::vector<unsigned char> *data, int n_channels, int sample_rate, int bit_depth);
Error write_frames (const std::vector<float>& frames) override; Error write_frames (const std::vector<float>& frames) override;
Error close() override; Error close() override;
int bit_depth() const override; int bit_depth() const override;
......
...@@ -104,7 +104,7 @@ main (int argc, char **argv) ...@@ -104,7 +104,7 @@ main (int argc, char **argv)
fprintf (stderr, "testlimiter: open input failed: %s\n", err.message()); fprintf (stderr, "testlimiter: open input failed: %s\n", err.message());
return 1; return 1;
} }
err = out.open (argv[2], in.n_channels(), in.sample_rate(), 16, in.n_frames()); err = out.open (argv[2], in.n_channels(), in.sample_rate(), 16);
if (err) if (err)
{ {
fprintf (stderr, "testlimiter: open output failed: %s\n", err.message()); fprintf (stderr, "testlimiter: open output failed: %s\n", err.message());
......
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