Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
94a92a0e
Commit
94a92a0e
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #9782: initialize all vars in iaxvoiplink
parent
4a8ae4e2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/iax/iaxvoiplink.cpp
+13
-10
13 additions, 10 deletions
daemon/src/iax/iaxvoiplink.cpp
daemon/src/iax/iaxvoiplink.h
+3
-3
3 additions, 3 deletions
daemon/src/iax/iaxvoiplink.h
with
16 additions
and
13 deletions
daemon/src/iax/iaxvoiplink.cpp
+
13
−
10
View file @
94a92a0e
...
@@ -47,6 +47,9 @@ IAXVoIPLink::IAXVoIPLink(const std::string& accountID) :
...
@@ -47,6 +47,9 @@ IAXVoIPLink::IAXVoIPLink(const std::string& accountID) :
,
regSession_
(
NULL
)
,
regSession_
(
NULL
)
,
nextRefreshStamp_
(
0
)
,
nextRefreshStamp_
(
0
)
,
mutexIAX_
()
,
mutexIAX_
()
,
decData_
()
,
resampledData_
()
,
encodedData_
()
,
converter_
(
44100
)
,
converter_
(
44100
)
,
initDone_
(
false
)
,
initDone_
(
false
)
,
accountID_
(
accountID
)
,
accountID_
(
accountID
)
...
@@ -167,7 +170,7 @@ IAXVoIPLink::sendAudioFromMic()
...
@@ -167,7 +170,7 @@ IAXVoIPLink::sendAudioFromMic()
continue
;
continue
;
// Get bytes from micRingBuffer to data_from_mic
// Get bytes from micRingBuffer to data_from_mic
int
bytes
=
Manager
::
instance
().
getMainBuffer
()
->
getData
(
decData
,
bytesNeeded
,
currentCall
->
getCallId
());
int
bytes
=
Manager
::
instance
().
getMainBuffer
()
->
getData
(
decData
_
,
bytesNeeded
,
currentCall
->
getCallId
());
int
samples
=
bytes
/
sizeof
(
SFLDataFormat
);
int
samples
=
bytes
/
sizeof
(
SFLDataFormat
);
int
compSize
;
int
compSize
;
...
@@ -176,20 +179,20 @@ IAXVoIPLink::sendAudioFromMic()
...
@@ -176,20 +179,20 @@ IAXVoIPLink::sendAudioFromMic()
SFLDataFormat
*
in
;
SFLDataFormat
*
in
;
if
(
audioRate
!=
mainBufferSampleRate
)
{
if
(
audioRate
!=
mainBufferSampleRate
)
{
converter_
.
resample
(
decData
,
resampledData
,
audioRate
,
mainBufferSampleRate
,
samples
);
converter_
.
resample
(
decData
_
,
resampledData
_
,
audioRate
,
mainBufferSampleRate
,
samples
);
in
=
resampledData
;
in
=
resampledData
_
;
outSamples
=
0
;
outSamples
=
0
;
}
else
{
}
else
{
outSamples
=
samples
;
outSamples
=
samples
;
in
=
decData
;
in
=
decData
_
;
}
}
compSize
=
audioCodec
->
encode
(
encodedData
,
in
,
DEC_BUFFER_SIZE
);
compSize
=
audioCodec
->
encode
(
encodedData
_
,
in
,
DEC_BUFFER_SIZE
);
if
(
currentCall
->
session
and
bytes
>
0
)
{
if
(
currentCall
->
session
and
bytes
>
0
)
{
ost
::
MutexLock
m
(
mutexIAX_
);
ost
::
MutexLock
m
(
mutexIAX_
);
if
(
iax_send_voice
(
currentCall
->
session
,
currentCall
->
format
,
encodedData
,
compSize
,
outSamples
)
==
-
1
)
if
(
iax_send_voice
(
currentCall
->
session
,
currentCall
->
format
,
encodedData
_
,
compSize
,
outSamples
)
==
-
1
)
ERROR
(
"IAX: Error sending voice data."
);
ERROR
(
"IAX: Error sending voice data."
);
}
}
}
}
...
@@ -562,15 +565,15 @@ void IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
...
@@ -562,15 +565,15 @@ void IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
if
(
size
>
max
)
if
(
size
>
max
)
size
=
max
;
size
=
max
;
int
samples
=
audioCodec
->
decode
(
decData
,
data
,
size
);
int
samples
=
audioCodec
->
decode
(
decData
_
,
data
,
size
);
int
outSize
=
samples
*
sizeof
(
SFLDataFormat
);
int
outSize
=
samples
*
sizeof
(
SFLDataFormat
);
SFLDataFormat
*
out
=
decData
;
SFLDataFormat
*
out
=
decData
_
;
unsigned
int
audioRate
=
audioCodec
->
getClockRate
();
unsigned
int
audioRate
=
audioCodec
->
getClockRate
();
if
(
audioRate
!=
mainBufferSampleRate
)
{
if
(
audioRate
!=
mainBufferSampleRate
)
{
outSize
=
(
double
)
outSize
*
(
mainBufferSampleRate
/
audioRate
);
outSize
=
(
double
)
outSize
*
(
mainBufferSampleRate
/
audioRate
);
converter_
.
resample
(
decData
,
resampledData
,
mainBufferSampleRate
,
audioRate
,
samples
);
converter_
.
resample
(
decData
_
,
resampledData
_
,
mainBufferSampleRate
,
audioRate
,
samples
);
out
=
resampledData
;
out
=
resampledData
_
;
}
}
Manager
::
instance
().
getMainBuffer
()
->
putData
(
out
,
outSize
,
call
->
getCallId
());
Manager
::
instance
().
getMainBuffer
()
->
putData
(
out
,
outSize
,
call
->
getCallId
());
...
...
This diff is collapsed.
Click to expand it.
daemon/src/iax/iaxvoiplink.h
+
3
−
3
View file @
94a92a0e
...
@@ -250,9 +250,9 @@ class IAXVoIPLink : public VoIPLink {
...
@@ -250,9 +250,9 @@ class IAXVoIPLink : public VoIPLink {
ost
::
Mutex
mutexIAX_
;
ost
::
Mutex
mutexIAX_
;
/** encoder/decoder/resampler buffers */
/** encoder/decoder/resampler buffers */
SFLDataFormat
decData
[
DEC_BUFFER_SIZE
];
SFLDataFormat
decData
_
[
DEC_BUFFER_SIZE
];
SFLDataFormat
resampledData
[
DEC_BUFFER_SIZE
];
SFLDataFormat
resampledData
_
[
DEC_BUFFER_SIZE
];
unsigned
char
encodedData
[
DEC_BUFFER_SIZE
];
unsigned
char
encodedData
_
[
DEC_BUFFER_SIZE
];
/** Sample rate converter object */
/** Sample rate converter object */
SamplerateConverter
converter_
;
SamplerateConverter
converter_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment