Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
05bd803e
Commit
05bd803e
authored
Mar 24, 2017
by
Anne Heimes
Browse files
server bugfix
parent
74604554
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ITANetAudioStreamingServer.cpp
View file @
05bd803e
...
...
@@ -92,7 +92,6 @@ bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort
m_oServerParams
.
iRingBufferSize
=
oClientParams
.
iRingBufferSize
;
m_oServerParams
.
iTargetSampleLatency
=
oClientParams
.
iTargetSampleLatency
;
m_oServerParams
.
iBlockSize
=
oClientParams
.
iBlockSize
;
m_oServerParams
.
dTimeIntervalSendInfos
=
dTimeIntervalCientSendStatus
;
m_iClientRingBufferFreeSamples
=
m_oServerParams
.
iTargetSampleLatency
;
m_dLastTimeStamp
=
ITAClock
::
getDefaultClock
()
->
getTime
();
...
...
@@ -144,8 +143,8 @@ bool CITANetAudioStreamingServer::LoopBody( )
int
iSendBlocks
=
iClientRingBufferTargetLatencyFreeSamples
/
iBlockLength
;
bAskClient
=
true
;
if
(
m_sfTempTransmitBuffer
.
GetLength
(
)
!=
iSendBlocks
*
iBlockLength
)
m_sfTempTransmitBuffer
.
init
(
m_pInputStream
->
GetNumberOfChannels
(
),
iSendBlocks
*
iBlockLength
,
false
);
if
(
m_sfTempTransmitBuffer
.
GetLength
(
)
!=
iBlockLength
)
m_sfTempTransmitBuffer
.
init
(
m_pInputStream
->
GetNumberOfChannels
(
),
iBlockLength
,
false
);
for
(
int
j
=
0
;
j
<
iSendBlocks
;
j
++
)
{
...
...
@@ -156,15 +155,15 @@ bool CITANetAudioStreamingServer::LoopBody( )
const
float
*
pfData
=
m_pInputStream
->
GetBlockPointer
(
i
,
&
oStreamInfo
);
if
(
pfData
!=
0
)
m_sfTempTransmitBuffer
[
i
].
write
(
pfData
,
iBlockLength
,
j
*
iBlockLength
);
m_sfTempTransmitBuffer
[
i
].
write
(
pfData
,
iBlockLength
,
0
);
}
m_pInputStream
->
IncrementBlockPointer
(
);
iMsgType
=
CITANetAudioProtocol
::
NP_SERVER_SENDING_SAMPLES
;
m_pMessage
->
SetMessageType
(
iMsgType
);
m_pMessage
->
WriteSampleFrame
(
&
m_sfTempTransmitBuffer
);
m_pMessage
->
WriteMessage
(
);
m_iClientRingBufferFreeSamples
-=
iBlockLength
;
}
iMsgType
=
CITANetAudioProtocol
::
NP_SERVER_SENDING_SAMPLES
;
m_pMessage
->
SetMessageType
(
iMsgType
);
m_pMessage
->
WriteSampleFrame
(
&
m_sfTempTransmitBuffer
);
m_pMessage
->
WriteMessage
();
m_iClientRingBufferFreeSamples
-=
iSendBlocks
*
iBlockLength
;
#ifdef NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"[ITANetAudioStreamingServer] Transmitted "
<<
iSendSamples
<<
" samples for "
<<
m_pInputStream
->
GetNumberOfChannels
()
<<
" channels"
<<
std
::
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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