Browse Source

Try to stop rtmidi from crashing on start; Fix typo

tags/1.9.8
falkTX 7 years ago
parent
commit
de1a514e49
2 changed files with 12 additions and 3 deletions
  1. +11
    -2
      source/backend/engine/CarlaEngineRtAudio.cpp
  2. +1
    -1
      source/modules/rtmidi/RtMidi.cpp

+ 11
- 2
source/backend/engine/CarlaEngineRtAudio.cpp View File

@@ -789,7 +789,12 @@ protected:
newRtMidiPortName += ":";
newRtMidiPortName += portName;

RtMidiIn* const rtMidiIn(new RtMidiIn(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer(), 512));
RtMidiIn* rtMidiIn;

try {
rtMidiIn = new RtMidiIn(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer(), 512);
} CARLA_SAFE_EXCEPTION_RETURN("new RtMidiIn", false);

rtMidiIn->ignoreTypes();
rtMidiIn->setCallback(carla_rtmidi_callback, this);

@@ -836,7 +841,11 @@ protected:
newRtMidiPortName += ":";
newRtMidiPortName += portName;

RtMidiOut* const rtMidiOut(new RtMidiOut(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer()));
RtMidiOut* rtMidiOut;

try {
rtMidiOut = new RtMidiOut(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer());
} CARLA_SAFE_EXCEPTION_RETURN("new RtMidiOut", false);

bool found = false;
uint rtMidiPortIndex;


+ 1
- 1
source/modules/rtmidi/RtMidi.cpp View File

@@ -931,7 +931,7 @@ void MidiOutCore :: initialize( const std::string& clientName )
OSStatus result = MIDIClientCreate(name, NULL, NULL, &client );
if ( result != noErr ) {
std::ostringstream ost;
ost << "MidiInCore::initialize: error creating OS-X MIDI client object (" << result << ").";
ost << "MidiOutCore::initialize: error creating OS-X MIDI client object (" << result << ").";
errorString_ = ost.str();
error( RtMidiError::DRIVER_ERROR, errorString_ );
return;


Loading…
Cancel
Save