Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TPF
jack2
Commits
6bc958ef
Commit
6bc958ef
authored
Jan 23, 2014
by
Stephane Letz
Browse files
Correct NetIntAudioBuffer.
parent
c2e0ca73
Changes
3
Hide whitespace changes
Inline
Side-by-side
common/JackNetAPI.cpp
View file @
6bc958ef
...
...
@@ -844,6 +844,8 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
return
SOCKET_ERROR
;
}
if
(
fFrames
<
0
)
fFrames
=
fParams
.
fPeriodSize
;
fProcessCallback
(
fFrames
,
fParams
.
fSendAudioChannels
,
fAudioCaptureBuffer
,
...
...
common/JackNetTool.cpp
View file @
6bc958ef
...
...
@@ -996,23 +996,23 @@ namespace Jack
int
NetIntAudioBuffer
::
RenderFromJackPorts
()
{
// Count active ports
int
active_ports
=
0
;
for
(
int
port_index
=
0
;
port_index
<
fNPorts
;
port_index
++
)
{
if
(
fPortBuffer
[
port_index
])
{
for
(
uint
frame
=
0
;
frame
<
fPeriodSize
;
frame
++
)
{
fIntBuffer
[
port_index
][
frame
]
=
short
(
fPortBuffer
[
port_index
][
frame
]
*
3276
8
.
f
);
fIntBuffer
[
port_index
][
frame
]
=
short
(
fPortBuffer
[
port_index
][
frame
]
*
3276
7
.
f
);
}
active_ports
++
;
}
else
{
memset
(
fIntBuffer
[
port_index
],
0
,
fPeriodSize
*
sizeof
(
short
));
}
}
return
active_ports
;
// All ports active
return
fNPorts
;
}
void
NetIntAudioBuffer
::
RenderToJackPorts
()
{
float
coef
=
1.
f
/
3276
8
.
f
;
float
coef
=
1.
f
/
3276
7
.
f
;
for
(
int
port_index
=
0
;
port_index
<
fNPorts
;
port_index
++
)
{
if
(
fPortBuffer
[
port_index
])
{
for
(
uint
frame
=
0
;
frame
<
fPeriodSize
;
frame
++
)
{
...
...
common/JackNetTool.h
View file @
6bc958ef
...
...
@@ -180,7 +180,7 @@ namespace Jack
uint32_t
fActivePorts
;
//number of active ports
uint32_t
fCycle
;
//process cycle counter
uint32_t
fSubCycle
;
//midi/audio subcycle counter
u
int32_t
fFrames
;
//process cycle size in frames
int32_t
fFrames
;
//process cycle size in frames
(can be -1 to indicate entire buffer)
uint32_t
fIsLastPckt
;
//is it the last packet of a given cycle ('y' or 'n')
}
POST_PACKED_STRUCTURE
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment