summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-07 12:00:23 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-07 12:00:23 -0400
commit79cb2875fef3771623f01ecf1e3c0c494f683855 (patch)
tree55b237dcb1799a7624157a041671788f9c6e4a13
parent323f39d8b6d093741b612244935684bfc53a0360 (diff)
parent92161b57ad8eb65c5f3e265388c353d36ce20c8d (diff)
Merge branch 'master' of git.ardour.org:ardour/ardour
-rw-r--r--gtk2_ardour/system_exec.cc11
-rw-r--r--gtk2_ardour/video_timeline.cc57
-rw-r--r--libs/ardour/butler.cc3
-rw-r--r--libs/ardour/rdff.c2
-rw-r--r--libs/midi++2/ipmidi_port.cc4
-rw-r--r--libs/pbd/crossthread.cc2
-rw-r--r--libs/pbd/file_manager.cc3
-rw-r--r--libs/pbd/sndfile_manager.cc7
-rw-r--r--libs/surfaces/osc/osc.cc7
9 files changed, 60 insertions, 36 deletions
diff --git a/gtk2_ardour/system_exec.cc b/gtk2_ardour/system_exec.cc
index 29e8cb913e..ca059dada5 100644
--- a/gtk2_ardour/system_exec.cc
+++ b/gtk2_ardour/system_exec.cc
@@ -445,10 +445,13 @@ SystemExec::wait (int options)
int status=0;
if (pid==0) return -1;
if (pid==::waitpid(pid, &status, options)) {
- pid=0;
- }
- if (errno == ECHILD) {
- pid=0;
+ if (WEXITSTATUS(status) || WIFSIGNALED(status)) {
+ pid=0;
+ }
+ } else {
+ if (errno == ECHILD) {
+ pid=0;
+ }
}
return status;
}
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc
index d8913f27aa..d8e129a2de 100644
--- a/gtk2_ardour/video_timeline.cc
+++ b/gtk2_ardour/video_timeline.cc
@@ -150,44 +150,41 @@ VideoTimeLine::set_session (ARDOUR::Session *s)
return;
}
- if (node) {
- ARDOUR_UI::instance()->start_video_server((Gtk::Window*)0, false);
+ ARDOUR_UI::instance()->start_video_server((Gtk::Window*)0, false);
- set_id(*node);
+ set_id(*node);
- const XMLProperty* proph = node->property (X_("Height"));
- if (proph) {
- editor->set_video_timeline_height(atoi(proph->value().c_str()));
- }
+ const XMLProperty* proph = node->property (X_("Height"));
+ if (proph) {
+ editor->set_video_timeline_height(atoi(proph->value().c_str()));
+ }
#if 0 /* TODO THINK: set FPS first time only ?! */
- const XMLProperty* propasfps = node->property (X_("AutoFPS"));
- if (propasfps) {
- auto_set_session_fps = atoi(propasfps->value().c_str())?true:false;
- }
+ const XMLProperty* propasfps = node->property (X_("AutoFPS"));
+ if (propasfps) {
+ auto_set_session_fps = atoi(propasfps->value().c_str())?true:false;
+ }
#endif
- const XMLProperty* propoffset = node->property (X_("VideoOffset"));
- if (propoffset) {
- video_offset = atoll(propoffset->value().c_str());
- video_offset_p = video_offset;
- }
-
- const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
- if (proplock) {
- video_offset_lock = atoi(proplock->value().c_str())?true:false;
- }
+ const XMLProperty* propoffset = node->property (X_("VideoOffset"));
+ if (propoffset) {
+ video_offset = atoll(propoffset->value().c_str());
+ video_offset_p = video_offset;
+ }
- const XMLProperty* localfile = node->property (X_("LocalFile"));
- if (localfile) {
- local_file = atoi(localfile->value().c_str())?true:false;
- }
+ const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
+ if (proplock) {
+ video_offset_lock = atoi(proplock->value().c_str())?true:false;
+ }
- const XMLProperty* propf = node->property (X_("Filename"));
- video_file_info(propf->value(), local_file);
+ const XMLProperty* localfile = node->property (X_("LocalFile"));
+ if (localfile) {
+ local_file = atoi(localfile->value().c_str())?true:false;
}
- node = _session->extra_xml (X_("Videomonitor"));
- if (node) {
+ const XMLProperty* propf = node->property (X_("Filename"));
+ video_file_info(propf->value(), local_file);
+
+ if ((node = _session->extra_xml (X_("Videomonitor")))) {
const XMLProperty* prop = node->property (X_("active"));
if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
open_video_monitor();
@@ -507,7 +504,7 @@ VideoTimeLine::video_file_info (std::string filename, bool local)
}
_session->config.set_video_pullup(0); /* TODO only set if set_timecode_format() was successful ?!*/
}
- if (video_file_fps != _session->timecode_frames_per_second()) {
+ if (floor(video_file_fps*100) != floor(_session->timecode_frames_per_second()*100)) {
warning << _("Video file's framerate is not equal to Ardour session timecode's framerate: ")
<< video_file_fps << _(" vs ") << _session->timecode_frames_per_second() << endmsg;
}
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc
index db1b316368..119f01fc6b 100644
--- a/libs/ardour/butler.cc
+++ b/libs/ardour/butler.cc
@@ -110,6 +110,9 @@ Butler::start_thread()
return -1;
}
+ fcntl(request_pipe[0], F_SETFD, fcntl(request_pipe[0], F_GETFD) | FD_CLOEXEC);
+ fcntl(request_pipe[1], F_SETFD, fcntl(request_pipe[1], F_GETFD) | FD_CLOEXEC);
+
//pthread_detach (thread);
return 0;
diff --git a/libs/ardour/rdff.c b/libs/ardour/rdff.c
index ca8e1abf1f..9dbb6ddae1 100644
--- a/libs/ardour/rdff.c
+++ b/libs/ardour/rdff.c
@@ -74,6 +74,8 @@ rdff_open(const char* path, bool write)
}
}
+ fcntl(fileno(fd), F_SETFD, fcntl(fileno(fd), F_GETFD) | FD_CLOEXEC);
+
RDFF ret = (RDFF)malloc(sizeof(struct _RDFF));
ret->fd = fd;
ret->size = size;
diff --git a/libs/midi++2/ipmidi_port.cc b/libs/midi++2/ipmidi_port.cc
index c90a3dbe6f..543c63e343 100644
--- a/libs/midi++2/ipmidi_port.cc
+++ b/libs/midi++2/ipmidi_port.cc
@@ -160,6 +160,8 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
return false;
}
+ fcntl(sockin, F_SETFD, fcntl(sockin, F_GETFD) | FD_CLOEXEC);
+
struct sockaddr_in addrin;
::memset(&addrin, 0, sizeof(addrin));
addrin.sin_family = AF_INET;
@@ -206,6 +208,8 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
::perror("socket(out)");
return false;
}
+
+ fcntl(sockout, F_SETFD, fcntl(sockout, F_GETFD) | FD_CLOEXEC);
// Will Hall, Oct 2007
if (!ifname.empty()) {
diff --git a/libs/pbd/crossthread.cc b/libs/pbd/crossthread.cc
index 2ffede5163..aa9d2edcd2 100644
--- a/libs/pbd/crossthread.cc
+++ b/libs/pbd/crossthread.cc
@@ -52,6 +52,8 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
return;
}
}
+ fcntl(fds[0], F_SETFD, fcntl(fds[0], F_GETFD) | FD_CLOEXEC);
+ fcntl(fds[1], F_SETFD, fcntl(fds[1], F_GETFD) | FD_CLOEXEC);
}
CrossThreadChannel::~CrossThreadChannel ()
diff --git a/libs/pbd/file_manager.cc b/libs/pbd/file_manager.cc
index a71ffca190..fb3227a922 100644
--- a/libs/pbd/file_manager.cc
+++ b/libs/pbd/file_manager.cc
@@ -289,6 +289,9 @@ StdioFileDescriptor::open ()
/* we must have a lock on the FileManager's mutex */
_file = fopen (_path.c_str(), _mode.c_str());
+ if (_file) {
+ fcntl(fileno(_file), F_SETFD, fcntl(fileno(_file), F_GETFD) | FD_CLOEXEC);
+ }
return (_file == 0);
}
diff --git a/libs/pbd/sndfile_manager.cc b/libs/pbd/sndfile_manager.cc
index d1dcd05256..4977f21dfd 100644
--- a/libs/pbd/sndfile_manager.cc
+++ b/libs/pbd/sndfile_manager.cc
@@ -90,7 +90,12 @@ SndFileDescriptor::open ()
{
/* we must have a lock on the FileManager's mutex */
- _sndfile = sf_open (_path.c_str(), _writeable ? SFM_RDWR : SFM_READ, _info);
+ int fd = ::open(_path.c_str(), O_LARGEFILE | (_writeable ? (O_RDWR) : O_RDONLY));
+ if (fd == -1) return false;
+ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+
+ _sndfile = sf_open_fd (fd, _writeable ? SFM_RDWR : SFM_READ, _info, 1);
+
return (_sndfile == 0);
}
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 009587ce85..9e80554f0b 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -166,6 +166,9 @@ OSC::start ()
_port++;
continue;
}
+
+ int fd = lo_server_get_socket_fd (_osc_server);
+ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
#ifdef ARDOUR_OSC_UNIX_SERVER
@@ -174,7 +177,7 @@ OSC::start ()
// attempt to create unix socket server too
snprintf(tmpstr, sizeof(tmpstr), "/tmp/sooperlooper_XXXXXX");
- int fd = mkstemp(tmpstr);
+ fd = mkstemp(tmpstr);
if (fd >= 0 ) {
unlink (tmpstr);
@@ -185,6 +188,8 @@ OSC::start ()
if (_osc_unix_server) {
_osc_unix_socket_path = tmpstr;
}
+ fd = lo_server_get_socket_fd (_osc_unix_server)
+ fcntl(fdx, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
#endif