Commit 008872fc authored by Stephane Letz's avatar Stephane Letz
Browse files

Possible fix in JackPosixSemaphore::ConnectInput, cleanup.

parent 1ed50c92
......@@ -199,7 +199,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
// Request socket
if (fSocket.NewSocket() == SOCKET_ERROR) {
jack_error("Can't create the network management input socket : %s", StrError(NET_ERROR_CODE));
jack_error("Can't create the network manager input socket : %s", StrError(NET_ERROR_CODE));
return -1;
}
......
......@@ -411,7 +411,7 @@ void jack_flush_adapter(jack_adapter_t* adapter);
int jack_adapter_push_and_pull(jack_adapter_t* adapter, float** input, float** output, unsigned int frames);
/**
* Pull input to and push output from adapter ringbuffer.
* Pull input from and push output to adapter ringbuffer.
*
* @param adapter the adapter
* @param input an array of audio input buffers
......
......@@ -110,6 +110,36 @@ namespace Jack
#endif
StrError(NET_ERROR_CODE);
}
int tos = 0; /* see <netinet/in.h> */
/*
DSCP Field Hex/Bin/Dec Layer 2 Prio Traffic Type Acronym WMM Access Category
0x38 / 111000 / 56 7 Network Control NC AC_VO
0x30 / 110000 / 48 6 Voice VO AC_VO
0x28 / 101000 / 40 5 Video VI AC_VI
0x20 / 100000 / 32 4 Controlled Load CL AC_VI
0x18 / 011000 / 24 3 Excellent Effort EE AC_BE
0x10 / 010000 / 16 2 Spare -- AC_BK
0x08 / 001000 / 8 1 Background BK AC_BK
0x00 / 000000 / 0 0 Best Effort BE AC_BE
*/
/*
socklen_t len = sizeof(tos);
res = getsockopt(fSockfd, IPPROTO_IP, IP_TOS, &tos, &len);
printf("getsockopt IPPROTO_IP res = %d tos = %d\n", res, tos);
tos = 46 * 4; // see <netinet/in.h>
res = setsockopt(fSockfd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
printf("setsockopt IPPROTO_IP res = %d tos = %d\n", res, tos );
res = getsockopt(fSockfd, IPPROTO_IP, IP_TOS, &tos, &len);
printf("getsockopt IPPROTO_IP res = %d tos = %d\n", res, tos);
*/
return fSockfd;
}
......
......@@ -48,8 +48,9 @@ bool JackPosixSemaphore::Signal()
return false;
}
if (fFlush)
if (fFlush) {
return true;
}
if ((res = sem_post(fSemaphore)) != 0) {
jack_error("JackPosixSemaphore::Signal name = %s err = %s", fName, strerror(errno));
......@@ -66,8 +67,9 @@ bool JackPosixSemaphore::SignalAll()
return false;
}
if (fFlush)
if (fFlush) {
return true;
}
if ((res = sem_post(fSemaphore)) != 0) {
jack_error("JackPosixSemaphore::SignalAll name = %s err = %s", fName, strerror(errno));
......@@ -172,11 +174,13 @@ bool JackPosixSemaphore::ConnectInput(const char* name, const char* server_name)
if ((fSemaphore = sem_open(fName, O_RDWR)) == (sem_t*)SEM_FAILED) {
jack_error("Connect: can't connect named semaphore name = %s err = %s", fName, strerror(errno));
return false;
} else {
} else if (fSemaphore) {
int val = 0;
sem_getvalue(fSemaphore, &val);
jack_log("JackPosixSemaphore::Connect sem_getvalue %ld", val);
return true;
} else {
jack_error("Connect: fSemaphore not initialized!");
}
}
......
......@@ -23,7 +23,7 @@ History :
#include <ctype.h>
#include "profport.h" /* function prototypes in here */
#ifndef WIN32
#ifndef _WIN32
static int read_line (FILE *fp, char *bp, int size);
static int read_section(FILE *fp, char *section);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment