diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index c686ae3d27..5ad5c2b745 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -221,11 +221,6 @@ SMFSource::read_unlocked (Evoral::EventSink& destination, framepos_t framecnt_t SMFSource::write_unlocked (MidiRingBuffer& source, framepos_t position, framecnt_t duration) { - if (!_open && open_for_write()) { - error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg; - return 0; - } - if (!_writing) { mark_streaming_write_started (); } @@ -415,6 +410,12 @@ SMFSource::mark_streaming_midi_write_started (NoteMode mode) { /* CALLER MUST HOLD LOCK */ + if (!_open && open_for_write()) { + error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg; + /* XXX should probably throw or return something */ + return; + } + MidiSource::mark_streaming_midi_write_started (mode); Evoral::SMF::begin_write (); _last_ev_time_beats = 0.0;