mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-27 15:38:19 +01:00
Re-work Port construction slightly so that _flags is always initialised before reset() is called. Otherwise a decision is made based on an uninitialised variable (as spotted by valgrind)
git-svn-id: svn://localhost/ardour2/trunk@2568 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4d33fbac62
commit
fc9ab1ccbd
11 changed files with 21 additions and 18 deletions
|
|
@ -70,8 +70,8 @@ class AudioPort : public virtual Port {
|
|||
protected:
|
||||
friend class AudioEngine;
|
||||
|
||||
AudioPort (); // data buffer comes from elsewhere (e.g. JACK)
|
||||
AudioPort (nframes_t); // data buffer owned by ardour
|
||||
AudioPort (Flags); // data buffer comes from elsewhere (e.g. JACK)
|
||||
AudioPort (Flags, nframes_t); // data buffer owned by ardour
|
||||
void reset ();
|
||||
|
||||
/* engine isn't supposed to access below here */
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class MidiPort : public virtual Port {
|
|||
protected:
|
||||
friend class AudioEngine;
|
||||
|
||||
MidiPort (nframes_t bufsize);
|
||||
MidiPort (Flags, nframes_t bufsize);
|
||||
|
||||
/* engine isn't supposed to access below here */
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class Port : public virtual sigc::trackable {
|
|||
protected:
|
||||
friend class AudioEngine;
|
||||
|
||||
Port ();
|
||||
Port (Flags);
|
||||
|
||||
virtual int disconnect () = 0;
|
||||
virtual void recompute_total_latency() const = 0;
|
||||
|
|
|
|||
|
|
@ -26,15 +26,15 @@ using namespace std;
|
|||
nframes_t AudioPort::_short_over_length = 2;
|
||||
nframes_t AudioPort::_long_over_length = 10;
|
||||
|
||||
AudioPort::AudioPort()
|
||||
: _buffer (0)
|
||||
AudioPort::AudioPort(Flags flags)
|
||||
: Port (flags), _buffer (0)
|
||||
{
|
||||
_type = DataType::AUDIO;
|
||||
reset();
|
||||
}
|
||||
|
||||
AudioPort::AudioPort(nframes_t nframes)
|
||||
: _buffer (nframes)
|
||||
AudioPort::AudioPort(Flags flags, nframes_t nframes)
|
||||
: Port (flags), _buffer (nframes)
|
||||
{
|
||||
_type = DataType::AUDIO;
|
||||
reset();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ InternalAudioPort::default_mixdown (const list<InternalPort*>& ports, AudioBuffe
|
|||
}
|
||||
|
||||
InternalAudioPort::InternalAudioPort(const string& name, Flags flgs)
|
||||
: AudioPort (engine->frames_per_cycle())
|
||||
: Port (flgs)
|
||||
, AudioPort (flgs, engine->frames_per_cycle())
|
||||
, InternalPort (name, DataType::AUDIO, flgs)
|
||||
{
|
||||
_mixdown = default_mixdown;
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ InternalPort::set_engine (AudioEngine* e)
|
|||
}
|
||||
|
||||
InternalPort::InternalPort (const string& str, DataType type, Flags flags)
|
||||
: Port (flags)
|
||||
{
|
||||
set_name (str);
|
||||
_type = type;
|
||||
_flags = flags;
|
||||
}
|
||||
|
||||
InternalPort::~InternalPort ()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
using namespace ARDOUR;
|
||||
|
||||
JackAudioPort::JackAudioPort(const std::string& name, Flags flgs)
|
||||
: JackPort (name, DataType::AUDIO, flgs)
|
||||
: Port (flgs), AudioPort (flgs), JackPort (name, DataType::AUDIO, flgs)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@
|
|||
|
||||
using namespace ARDOUR;
|
||||
JackMidiPort::JackMidiPort (const std::string& name, Flags flgs)
|
||||
: JackPort (name, DataType::MIDI, flgs)
|
||||
, MidiPort (4096) // FIXME FIXME FIXME Jack needs to tell us this
|
||||
: Port (flgs)
|
||||
, JackPort (name, DataType::MIDI, flgs)
|
||||
, MidiPort (flgs, 4096) // FIXME FIXME FIXME Jack needs to tell us this
|
||||
, _nframes_this_cycle(0)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ using namespace std;
|
|||
AudioEngine* JackPort::engine = 0;
|
||||
|
||||
JackPort::JackPort (const std::string& name, DataType type, Flags flgs)
|
||||
: _port (0)
|
||||
: Port (flgs), _port (0)
|
||||
{
|
||||
_port = jack_port_register (engine->jack(), name.c_str(), type.to_jack_type(), flgs, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
||||
MidiPort::MidiPort (nframes_t bufsize)
|
||||
: _buffer (bufsize)
|
||||
MidiPort::MidiPort (Flags flags, nframes_t bufsize)
|
||||
: Port (flags), _buffer (bufsize)
|
||||
{
|
||||
_type = DataType::MIDI;
|
||||
reset();
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@
|
|||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
||||
Port::Port ()
|
||||
: _metering (0)
|
||||
Port::Port (Flags flags)
|
||||
: _flags (flags)
|
||||
, _metering (0)
|
||||
, _last_monitor (false)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue