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 */
}
}
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);
}
}
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);
}
}
Butler::summon ()
{
char c = Request::Run;
- ::write (request_pipe[1], &c, 1);
+ (void) ::write (request_pipe[1], &c, 1);
}
void
{
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);
}
{
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);
}
int
MidiDiskstream::use_new_write_source (uint32_t n)
{
- if (!recordable()) {
+ if (!_session.writable() || !recordable()) {
return 1;
}
return -1;
}
- _write_source->set_allow_remove_if_empty (true);
_write_source->mark_streaming_midi_write_started (_note_mode, _session.transport_frame());
return 0;
{
list<boost::shared_ptr<Source> > ret;
ret.push_back (_write_source);
- reset_write_sources (false);
+ use_new_write_source (0);
return ret;
}
if (_write_source && mark_write_complete) {
_write_source->mark_streaming_write_completed ();
- }
-
- use_new_write_source (0);
+ }
+ use_new_write_source (0);
}
int
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);
}
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 ();
}
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;
{
#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);