diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-01-22 12:52:06 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-01-23 12:25:49 -0500 |
commit | 3b2c23be93d70aaaedf5f36a4322d132f1ca5494 (patch) | |
tree | d4f5afe868237811725b34e5e29cc3e07f7b8e5c /libs/ardour/diskstream.cc | |
parent | 14734422042a90fe66d9f83bc81ed9c0a03ff5bb (diff) |
split apart read and write chunk size and offer platform-dependent sizes for reading. Write chunk size should remain unchanged from before.
Diffstat (limited to 'libs/ardour/diskstream.cc')
-rw-r--r-- | libs/ardour/diskstream.cc | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 427063c3a2..0e4b5fcc49 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -53,12 +53,8 @@ using namespace std; using namespace ARDOUR; using namespace PBD; -/* XXX This goes uninitialized when there is no ~/.config/ardour3 directory. - * I can't figure out why, so this will do for now (just stole the - * default from configuration_vars.h). 0 is not a good value for - * allocating buffer sizes.. - */ -ARDOUR::framecnt_t Diskstream::disk_io_chunk_frames = 1024 * 256 / sizeof (Sample); +ARDOUR::framecnt_t Diskstream::disk_read_chunk_frames = default_disk_read_chunk_frames (); +ARDOUR::framecnt_t Diskstream::disk_write_chunk_frames = default_disk_write_chunk_frames (); PBD::Signal0<void> Diskstream::DiskOverrun; PBD::Signal0<void> Diskstream::DiskUnderrun; @@ -772,3 +768,21 @@ Diskstream::disengage_record_enable () { g_atomic_int_set (&_record_enabled, 0); } + +framecnt_t +Diskstream::default_disk_read_chunk_frames() +{ +#ifdef PLATFORM_WINDOWS + return (2 * 1048576) / sizeof (Sample); +#elif defined __APPLE__ + return (4 * 1048576) / sizeof (Sample); +#else + return 65536; +#endif +} + +framecnt_t +Diskstream::default_disk_write_chunk_frames () +{ + return 65536; +} |