From 0ee1cbb07773a2ad94ed5111c0b658bf5825f96b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 1 Mar 2011 02:04:57 +0000 Subject: [PATCH] Make an aborted MIDI capture due to no data being received behave the same as an explicitly aborted capture. git-svn-id: svn://localhost/ardour2/branches/3.0@8999 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/midi_diskstream.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index abde495288..09b3ae1a40 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -1070,7 +1070,21 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen _playlist->thaw (); _session.add_command (new StatefulDiffCommand(_playlist)); - } + + } else { + + /* No data was recorded, so this capture will + effectively be aborted; do the same as we + do for an explicit abort. + */ + + if (_write_source) { + _write_source->mark_for_remove (); + _write_source->drop_references (); + _write_source.reset(); + } + } + mark_write_completed = true; }