13
0

ensure that working buffers (for gain + mixing) are large enough.

Remove AudioDiskstream and AudioSource _working_buffers_size members, since they are no longer used
This commit is contained in:
Paul Davis 2015-05-12 14:33:41 -04:00
parent 5f4f40205b
commit 2a5dbff87b
4 changed files with 7 additions and 9 deletions

View File

@ -249,7 +249,6 @@ class LIBARDOUR_API AudioDiskstream : public Diskstream
static void allocate_working_buffers();
static void free_working_buffers();
static size_t _working_buffers_size;
static Sample* _mixdown_buffer;
static gain_t* _gain_buffer;

View File

@ -109,8 +109,6 @@ class LIBARDOUR_API AudioSource : virtual public Source,
static bool _build_missing_peakfiles;
static bool _build_peakfiles;
static size_t _working_buffers_size;
/* these collections of working buffers for supporting
playlist's reading from potentially nested/recursive
sources assume SINGLE THREADED reads by the butler

View File

@ -63,7 +63,6 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
size_t AudioDiskstream::_working_buffers_size = 0;
Sample* AudioDiskstream::_mixdown_buffer = 0;
gain_t* AudioDiskstream::_gain_buffer = 0;
@ -134,9 +133,13 @@ AudioDiskstream::~AudioDiskstream ()
void
AudioDiskstream::allocate_working_buffers()
{
_working_buffers_size = max (disk_write_chunk_frames, disk_read_chunk_frames);
_mixdown_buffer = new Sample[_working_buffers_size];
_gain_buffer = new gain_t[_working_buffers_size];
/* with varifill buffer refilling, we compute the read size in bytes (to optimize
for disk i/o bandwidth) and then convert back into samples. These buffers
need to reflect the maximum size we could use, which is 4MB reads, or 2M samples
using 16 bit samples.
*/
_mixdown_buffer = new Sample[2*1048576];
_gain_buffer = new gain_t[2*1048576];
}
void
@ -144,7 +147,6 @@ AudioDiskstream::free_working_buffers()
{
delete [] _mixdown_buffer;
delete [] _gain_buffer;
_working_buffers_size = 0;
_mixdown_buffer = 0;
_gain_buffer = 0;
}

View File

@ -68,7 +68,6 @@ using namespace PBD;
Glib::Threads::Mutex AudioSource::_level_buffer_lock;
vector<boost::shared_array<Sample> > AudioSource::_mixdown_buffers;
vector<boost::shared_array<gain_t> > AudioSource::_gain_buffers;
size_t AudioSource::_working_buffers_size = 0;
bool AudioSource::_build_missing_peakfiles = false;
/** true if we want peakfiles (e.g. if we are displaying a GUI) */