summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-03-27 15:08:58 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-03-27 15:08:58 +0000
commit0a5d09bb335435a66c8b218aa857deed5fdd909f (patch)
tree4ee82edf3d1900acc93f75afb5665eb5a9123271 /libs
parent327109a240f178b16ebac48b4d351741515afd45 (diff)
no-cache-port-buffers fix from stephane letz
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4911 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/port.h21
-rw-r--r--libs/ardour/port.cc2
2 files changed, 3 insertions, 20 deletions
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 74eef70d29..bff6c7d298 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -33,24 +33,11 @@ class AudioEngine;
class Port : public sigc::trackable {
public:
virtual ~Port() {
- free (_port);
+ // Port is an opage pointer, so should be be desallocated ??
}
Sample *get_buffer (nframes_t nframes) {
- if (_flags & JackPortIsOutput) {
- return _buffer;
- } else {
- return (Sample *) jack_port_get_buffer (_port, nframes);
- }
- }
-
- void reset_buffer () {
- if (_flags & JackPortIsOutput) {
- _buffer = (Sample *) jack_port_get_buffer (_port, 0);
- } else {
- _buffer = 0; /* catch illegal attempts to use it */
- }
- _silent = false;
+ return (Sample *) jack_port_get_buffer (_port, nframes);
}
std::string name() {
@@ -166,7 +153,7 @@ class Port : public sigc::trackable {
/** Assumes that the port is an audio output port */
void silence (nframes_t nframes, nframes_t offset) {
if (!_silent) {
- memset (_buffer + offset, 0, sizeof (Sample) * nframes);
+ memset ((Sample *) jack_port_get_buffer (_port, nframes) + offset, 0, sizeof (Sample) * nframes);
if (offset == 0) {
/* XXX this isn't really true, but i am not sure
how to set this correctly. we really just
@@ -190,8 +177,6 @@ class Port : public sigc::trackable {
/* engine isn't supposed to below here */
- Sample *_buffer;
-
/* cache these 3 from JACK so that we can
access them for reconnecting.
*/
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc
index 4b0399702a..83c835cac6 100644
--- a/libs/ardour/port.cc
+++ b/libs/ardour/port.cc
@@ -42,8 +42,6 @@ Port::Port (jack_port_t *p)
void
Port::reset ()
{
- reset_buffer ();
-
_last_monitor = false;
_silent = false;
_metering = 0;