13
0

Clear existing data before reading new to make overwrite_existing_buffers() work correctly. Should fix #3481.

git-svn-id: svn://localhost/ardour2/branches/3.0@8256 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-12-12 21:36:40 +00:00
parent 6fff4dcdda
commit 9a1f83923d

View File

@ -629,6 +629,12 @@ MidiDiskstream::set_pending_overwrite (bool yn)
int int
MidiDiskstream::overwrite_existing_buffers () MidiDiskstream::overwrite_existing_buffers ()
{ {
/* This is safe as long as the butler thread is suspended, which it should be */
_playback_buf->reset ();
g_atomic_int_set (&_frames_read_from_ringbuffer, 0);
g_atomic_int_set (&_frames_written_to_ringbuffer, 0);
read (overwrite_frame, disk_io_chunk_frames, false); read (overwrite_frame, disk_io_chunk_frames, false);
overwrite_queued = false; overwrite_queued = false;
_pending_overwrite = false; _pending_overwrite = false;