From 937f75796e8116ea5c5f15f06d803e0d0b964bf7 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 27 Mar 2009 15:08:58 +0000 Subject: [PATCH] no-cache-port-buffers fix from stephane letz git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/2.0-ongoing@4911 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/port.h | 21 +++------------------ libs/ardour/port.cc | 2 -- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 74eef70d2..bff6c7d29 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 4b0399702..83c835cac 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; -- 2.11.4.GIT