Remove unused gain-buffer for master-read (NOOP)

This commit is contained in:
Robin Gareus 2024-04-08 15:36:11 +02:00
parent f3823e8d7c
commit 59b2369736
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 8 additions and 22 deletions

View File

@ -121,9 +121,10 @@ class LIBARDOUR_API AudioRegion : public Region, public AudioReadable
samplecnt_t cnt,
uint32_t chan_n = 0) const;
samplecnt_t master_read_at (Sample *buf, Sample *mixdown_buf, float *gain_buf,
samplepos_t position, samplecnt_t cnt,
uint32_t chan_n=0) const;
samplecnt_t master_read_at (Sample* buf,
samplepos_t position,
samplecnt_t cnt,
uint32_t chan_n=0) const;
samplecnt_t read_raw_internal (Sample*, samplepos_t, samplecnt_t, int channel) const;

View File

@ -475,8 +475,7 @@ AudioRegion::read (Sample* buf, samplepos_t pos, samplecnt_t cnt, int channel) c
}
samplecnt_t
AudioRegion::master_read_at (Sample* buf, Sample* /*mixdown_buffer*/, float* /*gain_buffer*/,
samplepos_t position, samplecnt_t cnt, uint32_t chan_n) const
AudioRegion::master_read_at (Sample* buf, samplepos_t position, samplecnt_t cnt, uint32_t chan_n) const
{
/* do not read gain/scaling/fades and do not count this disk i/o in statistics */

View File

@ -1216,7 +1216,7 @@ LuaAPI::Rubberband::set_mapping (luabridge::LuaRef tbl)
samplecnt_t
LuaAPI::Rubberband::read (Sample* buf, samplepos_t pos, samplecnt_t cnt, int channel) const
{
return _region->master_read_at (buf, NULL, NULL, _read_offset + pos, cnt, channel);
return _region->master_read_at (buf, _read_offset + pos, cnt, channel);
}
static void null_deleter (LuaAPI::Rubberband*) {}

View File

@ -77,7 +77,6 @@ RBEffect::run (std::shared_ptr<Region> r, Progress* progress)
SourceList nsrcs;
int ret = -1;
const samplecnt_t bufsize = 8192;
gain_t* gain_buffer = 0;
Sample** buffers = 0;
char suffix[32];
string new_name;
@ -201,8 +200,7 @@ RBEffect::run (std::shared_ptr<Region> r, Progress* progress)
goto out;
}
gain_buffer = new gain_t[bufsize];
buffers = new float*[channels];
buffers = new float*[channels];
for (uint32_t i = 0; i < channels; ++i) {
buffers[i] = new float[bufsize];
@ -225,8 +223,6 @@ RBEffect::run (std::shared_ptr<Region> r, Progress* progress)
region->start_sample () + region->position_sample ();
this_read = region->master_read_at (buffers[i],
buffers[i],
gain_buffer,
this_position,
this_time,
i);
@ -262,8 +258,6 @@ RBEffect::run (std::shared_ptr<Region> r, Progress* progress)
region->start_sample () + region->position_sample ();
this_read = region->master_read_at (buffers[i],
buffers[i],
gain_buffer,
this_position,
this_time,
i);
@ -377,8 +371,6 @@ RBEffect::run (std::shared_ptr<Region> r, Progress* progress)
out:
delete[] gain_buffer;
if (buffers) {
for (uint32_t i = 0; i < channels; ++i) {
delete[] buffers[i];

View File

@ -60,7 +60,6 @@ STStretch::run (std::shared_ptr<Region> r, Progress* progress)
SourceList nsrcs;
int ret = -1;
const samplecnt_t bufsize = 8192;
gain_t* gain_buffer = 0;
Sample** buffers = 0;
char suffix[32];
string new_name;
@ -181,8 +180,7 @@ STStretch::run (std::shared_ptr<Region> r, Progress* progress)
goto out;
}
gain_buffer = new gain_t[bufsize];
buffers = new float*[channels];
buffers = new float*[channels];
for (uint32_t i = 0; i < channels; ++i) {
buffers[i] = new float[bufsize];
@ -208,8 +206,6 @@ STStretch::run (std::shared_ptr<Region> r, Progress* progress)
region->start () + region->position ();
this_read = region->master_read_at (buffers[i],
buffers[i],
gain_buffer,
this_position,
this_time,
i);
@ -319,8 +315,6 @@ STStretch::run (std::shared_ptr<Region> r, Progress* progress)
out:
delete[] gain_buffer;
if (buffers) {
for (uint32_t i = 0; i < channels; ++i) {
delete[] buffers[i];