diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index a8a0e218a6..1d352d622b 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -722,6 +722,13 @@ MidiTrack::act_on_mute () XXX we should should also stop all relevant note trackers. */ + /* If we haven't got a diskstream yet, there's nothing to worry about, + and we can't call get_channel_mask() anyway. + */ + if (!midi_diskstream()) { + return; + } + if (muted()) { /* only send messages for channels we are using */ diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 7f307f3edc..1c45460088 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -119,12 +119,12 @@ Track::state (bool full) int Track::set_state (const XMLNode& node, int version) { + if (Route::set_state (node, version)) { + return -1; + } + XMLNode* child; - /* Create the diskstream before calling Route::set_state, as MidiTrack - needs it if the track is muted (it ends up calling MidiTrack::get_channel_mask) - */ - if (version >= 3000) { if ((child = find_named_node (node, X_("Diskstream"))) != 0) { boost::shared_ptr ds = diskstream_factory (*child); @@ -133,10 +133,6 @@ Track::set_state (const XMLNode& node, int version) } } - if (Route::set_state (node, version)) { - return -1; - } - if (_diskstream) { _diskstream->playlist()->set_orig_track_id (id()); }