diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-29 20:40:52 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-29 20:40:52 +0000 |
commit | dbf3ba2d73dfa2b3230ff5829e4a4a49c7c5ba5f (patch) | |
tree | d8511ecc93e977ca7afe03bd2a950add779f4aab | |
parent | 501db4747bd00a5f4ff8664a1375b93e3ea2c367 (diff) |
allow zero-length SMF files on disk again; fix some gcc 4.X optimization-on compile warnings
git-svn-id: svn://localhost/ardour2/branches/3.0@7329 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/audiosource.cc | 4 | ||||
-rw-r--r-- | libs/ardour/butler.cc | 8 | ||||
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 10 | ||||
-rw-r--r-- | libs/ardour/midi_port.cc | 6 | ||||
-rw-r--r-- | libs/ardour/region.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 13 | ||||
-rw-r--r-- | libs/ardour/source.cc | 2 |
7 files changed, 28 insertions, 17 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index a25e24ab7a..f309f599c5 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -880,7 +880,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, framepos_t first_frame, frame off_t target_length = blocksize * ((first_peak_byte + blocksize + 1) / blocksize); if (endpos < target_length) { - ftruncate (_peakfile_fd, target_length); + (void) ftruncate (_peakfile_fd, target_length); /* error doesn't actually matter though, so continue on without testing */ } } @@ -923,7 +923,7 @@ AudioSource::truncate_peakfile () off_t end = lseek (_peakfile_fd, 0, SEEK_END); if (end > _peak_byte_max) { - ftruncate (_peakfile_fd, _peak_byte_max); + (void) ftruncate (_peakfile_fd, _peak_byte_max); } } diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 1efca35196..3b717942f3 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -127,7 +127,7 @@ Butler::terminate_thread () if (thread) { void* status; const char c = Request::Quit; - ::write (request_pipe[1], &c, 1); + (void) ::write (request_pipe[1], &c, 1); pthread_join (thread, &status); } } @@ -383,7 +383,7 @@ void Butler::summon () { char c = Request::Run; - ::write (request_pipe[1], &c, 1); + (void) ::write (request_pipe[1], &c, 1); } void @@ -391,7 +391,7 @@ Butler::stop () { Glib::Mutex::Lock lm (request_lock); char c = Request::Pause; - ::write (request_pipe[1], &c, 1); + (void) ::write (request_pipe[1], &c, 1); paused.wait(request_lock); } @@ -400,7 +400,7 @@ Butler::wait_until_finished () { Glib::Mutex::Lock lm (request_lock); char c = Request::Wake; - ::write (request_pipe[1], &c, 1); + (void) ::write (request_pipe[1], &c, 1); paused.wait(request_lock); } diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 95e242e671..c3c5f53d50 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -1312,7 +1312,7 @@ MidiDiskstream::set_state (const XMLNode& node, int /*version*/) int MidiDiskstream::use_new_write_source (uint32_t n) { - if (!recordable()) { + if (!_session.writable() || !recordable()) { return 1; } @@ -1333,7 +1333,6 @@ MidiDiskstream::use_new_write_source (uint32_t n) return -1; } - _write_source->set_allow_remove_if_empty (true); _write_source->mark_streaming_midi_write_started (_note_mode, _session.transport_frame()); return 0; @@ -1344,7 +1343,7 @@ MidiDiskstream::steal_write_sources() { list<boost::shared_ptr<Source> > ret; ret.push_back (_write_source); - reset_write_sources (false); + use_new_write_source (0); return ret; } @@ -1357,9 +1356,8 @@ MidiDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/) if (_write_source && mark_write_complete) { _write_source->mark_streaming_write_completed (); - } - - use_new_write_source (0); + } + use_new_write_source (0); } int diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index 40cb48f54f..6858fd1cbd 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -75,6 +75,12 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset) jack_midi_event_get (&ev, jack_buffer, i); +#if 0 + if (ev.buffer[0] == 0xfe) { + /* throw away active sensing */ + continue; + } +#endif if (ev.time > off && ev.time < off+nframes) { _buffer->push_back (ev); } diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 076b0d1292..64c7d8c66a 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1534,14 +1534,12 @@ void Region::drop_sources () { for (SourceList::const_iterator i = _sources.begin (); i != _sources.end(); ++i) { - cerr << name() << " " << id() << " DEC DS\n"; (*i)->dec_use_count (); } _sources.clear (); for (SourceList::const_iterator i = _master_sources.begin (); i != _master_sources.end(); ++i) { - cerr << name() << " " << id() << " DEC MDS \n"; (*i)->dec_use_count (); } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 85d6a1689b..99a8ae2e9e 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2561,8 +2561,17 @@ Session::cleanup_sources (CleanupReport& rep) for (set<string>::iterator i = all_sources.begin(); i != all_sources.end(); ++i) { - realpath(spath.c_str(), tmppath1); - realpath((*i).c_str(), tmppath2); + if (realpath(spath.c_str(), tmppath1) == 0) { + error << string_compose (_("Cannot expand path %1 (%2)"), + spath, strerror (errno)) << endmsg; + continue; + } + + if (realpath((*i).c_str(), tmppath2) == 0) { + error << string_compose (_("Cannot expand path %1 (%2)"), + (*i), strerror (errno)) << endmsg; + continue; + } if (strcmp(tmppath1, tmppath2) == 0) { used = true; diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index 894233f436..f819e6eb42 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -277,8 +277,8 @@ Source::dec_use_count () { #ifndef NDEBUG gint oldval = g_atomic_int_exchange_and_add (&_use_count, -1); - cerr << "Bad use dec for " << name() << endl; if (oldval <= 0) { + cerr << "Bad use dec for " << name() << endl; abort (); } assert (oldval > 0); |