13
0

Merge branch 'master' of git.ardour.org:ardour/ardour

This commit is contained in:
Paul Davis 2013-06-07 12:00:23 -04:00
commit 79cb2875fe
9 changed files with 62 additions and 38 deletions

View File

@ -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;
}

View File

@ -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* localfile = node->property (X_("LocalFile"));
if (localfile) {
local_file = atoi(localfile->value().c_str())?true:false;
}
const XMLProperty* propf = node->property (X_("Filename"));
video_file_info(propf->value(), local_file);
const XMLProperty* propoffset = node->property (X_("VideoOffset"));
if (propoffset) {
video_offset = atoll(propoffset->value().c_str());
video_offset_p = video_offset;
}
node = _session->extra_xml (X_("Videomonitor"));
if (node) {
const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
if (proplock) {
video_offset_lock = atoi(proplock->value().c_str())?true:false;
}
const XMLProperty* localfile = node->property (X_("LocalFile"));
if (localfile) {
local_file = atoi(localfile->value().c_str())?true:false;
}
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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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()) {

View File

@ -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 ()

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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