Fix crash on multiple record due to not initiating write on source.
authorDavid Robillard <d@drobilla.net>
Fri, 23 Oct 2009 04:49:25 +0000 (04:49 +0000)
committerDavid Robillard <d@drobilla.net>
Fri, 23 Oct 2009 04:49:25 +0000 (04:49 +0000)
Fixes it, but this seems a bit dirty... audio has the same problem (but lives)...

git-svn-id: svn://localhost/ardour2/branches/3.0@5887 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_diskstream.cc

index 07cfbf215ce59e3f1d1226faf59bc21aff8710bd..262a29d1df4336fe52dd2747421a2ae4788dbe9f 100644 (file)
@@ -1367,6 +1367,7 @@ MidiDiskstream::use_new_write_source (uint32_t n)
        }
 
        _write_source->set_allow_remove_if_empty (true);
+       _write_source->mark_streaming_midi_write_started (_note_mode, _session.transport_frame());
 
        return 0;
 }
@@ -1374,7 +1375,7 @@ MidiDiskstream::use_new_write_source (uint32_t n)
 void
 MidiDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
 {
-       if (!recordable()) {
+       if (!_session.writable() || !recordable()) {
                return;
        }
 
@@ -1383,10 +1384,6 @@ MidiDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
        }
 
        use_new_write_source (0);
-
-       if (record_enabled()) {
-               //_capturing_sources.push_back (_write_source);
-       }
 }
 
 int