Commit 7fcc33a7 authored by sletz's avatar sletz
Browse files

Correct netjack2 packet size.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4383 0c269be4-1314-0410-8aa9-9f06e86f4224
parent ed5f02cf
......@@ -1816,12 +1816,18 @@ EXPORT int jack_internal_client_new (const char* client_name,
const char* load_name,
const char* load_init)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_internal_client_new");
#endif
jack_error("jack_internal_client_new: deprecated");
return -1;
}
EXPORT void jack_internal_client_close (const char* client_name)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_internal_client_close");
#endif
jack_error("jack_internal_client_close: deprecated");
}
......@@ -1873,7 +1879,7 @@ EXPORT jack_intclient_t jack_internal_client_load_aux(jack_client_t* ext_client,
jack_varargs_t va;
jack_status_t my_status;
if (status == NULL) /* no status from caller? */
if (status == NULL) /* no status from caller? */
status = &my_status; /* use local status word */
*status = (jack_status_t)0;
......@@ -1892,6 +1898,9 @@ EXPORT jack_intclient_t jack_internal_client_load_aux(jack_client_t* ext_client,
EXPORT jack_intclient_t jack_internal_client_load(jack_client_t *client, const char* client_name, jack_options_t options, jack_status_t *status, ...)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_internal_client_load");
#endif
va_list ap;
va_start(ap, status);
jack_intclient_t res = jack_internal_client_load_aux(client, client_name, options, status, ap);
......@@ -1918,14 +1927,14 @@ EXPORT jack_status_t jack_internal_client_unload(jack_client_t* ext_client, jack
}
}
EXPORT
void
jack_get_version(
int *major_ptr,
int *minor_ptr,
int *micro_ptr,
int *proto_ptr)
EXPORT void jack_get_version(int *major_ptr,
int *minor_ptr,
int *micro_ptr,
int *proto_ptr)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_get_version");
#endif
// FIXME: We need these comming from build system
*major_ptr = 0;
*minor_ptr = 0;
......@@ -1933,15 +1942,19 @@ jack_get_version(
*proto_ptr = 0;
}
EXPORT
const char*
jack_get_version_string()
EXPORT const char* jack_get_version_string()
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_get_version_string");
#endif
return VERSION;
}
EXPORT void jack_free(void* ptr)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_free");
#endif
if (ptr) {
free(ptr);
}
......@@ -1995,6 +2008,9 @@ EXPORT int jack_session_reply(jack_client_t* ext_client, jack_session_event_t *e
EXPORT void jack_session_event_free(jack_session_event_t* ev)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_session_event_free");
#endif
if (ev) {
if (ev->session_dir)
free((void *)ev->session_dir);
......@@ -2053,6 +2069,10 @@ EXPORT int jack_reserve_client_name(jack_client_t* ext_client, const char* clien
EXPORT void jack_session_commands_free(jack_session_command_t *cmds)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_session_commands_free");
#endif
if (!cmds)
return;
......
......@@ -158,7 +158,7 @@ namespace Jack
return false;
}
// If -1 at conection time, in/out channels count is sent by the master
// If -1 at connection time, in/out channels count is sent by the master
fCaptureChannels = fParams.fSendAudioChannels;
fPlaybackChannels = fParams.fReturnAudioChannels;
......
......@@ -401,7 +401,8 @@ namespace Jack
fTxHeader.fSubCycle = 0;
fTxHeader.fDataType = 's';
fTxHeader.fIsLastPckt = (fParams.fSendMidiChannels == 0 && fParams.fSendAudioChannels == 0) ? 1 : 0;
fTxHeader.fPacketSize = HEADER_SIZE;
//fTxHeader.fPacketSize = HEADER_SIZE;
fTxHeader.fPacketSize = fParams.fMtu;
memcpy(fTxBuffer, &fTxHeader, HEADER_SIZE);
return Send(fTxHeader.fPacketSize, 0);
......@@ -455,7 +456,8 @@ namespace Jack
int JackNetMasterInterface::SyncRecv()
{
packet_header_t* rx_head = reinterpret_cast<packet_header_t*>(fRxBuffer);
int rx_bytes = Recv(HEADER_SIZE, MSG_PEEK);
//int rx_bytes = Recv(HEADER_SIZE, MSG_PEEK);
int rx_bytes = Recv(fParams.fMtu, MSG_PEEK);
if ((rx_bytes == 0) || (rx_bytes == SOCKET_ERROR))
return rx_bytes;
......@@ -531,7 +533,8 @@ namespace Jack
while (!fRxHeader.fIsLastPckt)
{
//how much data is queued on the rx buffer ?
rx_bytes = Recv(HEADER_SIZE, MSG_PEEK);
//rx_bytes = Recv(HEADER_SIZE, MSG_PEEK);
rx_bytes = Recv(fParams.fMtu, MSG_PEEK);
//error here, problem with recv, just skip the cycle (return -1)
if (rx_bytes == SOCKET_ERROR)
......@@ -905,7 +908,8 @@ namespace Jack
//receive sync (launch the cycle)
do
{
rx_bytes = Recv(HEADER_SIZE, 0);
//rx_bytes = Recv(HEADER_SIZE, 0);
rx_bytes = Recv(fParams.fMtu, 0);
//connection issue, send will detect it, so don't skip the cycle (return 0)
if (rx_bytes == SOCKET_ERROR)
return rx_bytes;
......@@ -925,7 +929,8 @@ namespace Jack
while (!fRxHeader.fIsLastPckt)
{
//how much data is queued on the rx buffer ?
rx_bytes = Recv(HEADER_SIZE, MSG_PEEK);
//rx_bytes = Recv(HEADER_SIZE, MSG_PEEK);
rx_bytes = Recv(fParams.fMtu, MSG_PEEK);
//error here, problem with recv, just skip the cycle (return -1)
if (rx_bytes == SOCKET_ERROR)
......@@ -980,7 +985,8 @@ namespace Jack
fTxHeader.fSubCycle = 0;
fTxHeader.fDataType = 's';
fTxHeader.fIsLastPckt = (fParams.fReturnMidiChannels == 0 && fParams.fReturnAudioChannels == 0) ? 1 : 0;
fTxHeader.fPacketSize = HEADER_SIZE;
//fTxHeader.fPacketSize = HEADER_SIZE;
fTxHeader.fPacketSize = fParams.fMtu;
memcpy(fTxBuffer, &fTxHeader, HEADER_SIZE);
return Send(fTxHeader.fPacketSize, 0);
......
......@@ -1325,7 +1325,7 @@
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4B8692821371DB4700D2D11B /* Jacknet.framework 64 bits */;
remoteGlobalIDString = 4B8692821371DB4700D2D11B;
remoteInfo = "Jacknet.framework 64 bits";
};
4BD624D20CBCF55700DE782F /* PBXContainerItemProxy */ = {
......
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