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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
f6c94459
Commit
f6c94459
authored
17 years ago
by
Alexandre Bourget
Browse files
Options
Downloads
Patches
Plain Diff
Pointers are reset to NULL (not 0)
parent
39ae5dd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/audio/audiortp.cpp
+16
-12
16 additions, 12 deletions
src/audio/audiortp.cpp
src/audio/codecDescriptor.cpp
+1
-1
1 addition, 1 deletion
src/audio/codecDescriptor.cpp
src/sipcall.cpp
+2
-2
2 additions, 2 deletions
src/sipcall.cpp
with
19 additions
and
15 deletions
src/audio/audiortp.cpp
+
16
−
12
View file @
f6c94459
...
...
@@ -137,19 +137,19 @@ AudioRtpRTX::~AudioRtpRTX () {
_ca
=
0
;
if
(
!
_sym
)
{
delete
_sessionRecv
;
_sessionRecv
=
0
;
delete
_sessionSend
;
_sessionSend
=
0
;
delete
_sessionRecv
;
_sessionRecv
=
NULL
;
delete
_sessionSend
;
_sessionSend
=
NULL
;
}
else
{
delete
_session
;
_session
=
0
;
delete
_session
;
_session
=
NULL
;
}
delete
[]
_intBuffer8000
;
_intBuffer8000
=
0
;
delete
[]
_floatBuffer48000
;
_floatBuffer48000
=
0
;
delete
[]
_floatBuffer8000
;
_floatBuffer8000
=
0
;
delete
[]
_dataAudioLayer
;
_dataAudioLayer
=
0
;
delete
[]
_intBuffer8000
;
_intBuffer8000
=
NULL
;
delete
[]
_floatBuffer48000
;
_floatBuffer48000
=
NULL
;
delete
[]
_floatBuffer8000
;
_floatBuffer8000
=
NULL
;
delete
[]
_dataAudioLayer
;
_dataAudioLayer
=
NULL
;
delete
[]
_sendDataEncoded
;
_sendDataEncoded
=
0
;
delete
[]
_receiveDataDecoded
;
_receiveDataDecoded
=
0
;
delete
[]
_sendDataEncoded
;
_sendDataEncoded
=
NULL
;
delete
[]
_receiveDataDecoded
;
_receiveDataDecoded
=
NULL
;
delete
time
;
time
=
NULL
;
...
...
@@ -339,6 +339,8 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
unsigned
char
*
data
=
(
unsigned
char
*
)
adu
->
getData
();
// data in char
unsigned
int
size
=
adu
->
getSize
();
// size in char
//_debug("PACKET SIZE: %d bytes\n", size);
if
(
size
>
RTP_20S_8KHZ_MAX
)
{
_debug
(
"We have received from RTP a packet larger than expected: %s VS %s
\n
"
,
size
,
RTP_20S_8KHZ_MAX
);
_debug
(
"The packet size has been cropped
\n
"
);
...
...
@@ -347,7 +349,7 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
// Decode data with relevant codec
AudioCodec
*
audiocodec
=
_ca
->
getCodecMap
().
getCodec
((
CodecType
)
payload
);
if
(
audiocodec
!=
0
)
{
if
(
audiocodec
!=
NULL
)
{
// codecDecode(int16 *dest, char* src, size in bytes of the src)
// decode multiply by two, so the number of byte should be double
// size shall be RTP_FRAME2SEND or lower
...
...
@@ -363,9 +365,11 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
int
nbSampleMaxRate
=
nbInt16
*
6
;
// TODO: change it
if
(
audiolayer
->
getSampleRate
()
!=
audiocodec
->
getClockRate
()
&&
nbSample
)
{
// convert here
double
factord
=
(
double
)
audiolayer
->
getSampleRate
()
/
audiocodec
->
getClockRate
();
// Do sample rate conversion
double
factord
=
(
double
)
audiolayer
->
getSampleRate
()
/
audiocodec
->
getClockRate
();
// SRC_DATA from samplerate.h
SRC_DATA
src_data
;
src_data
.
data_in
=
_floatBuffer8000
;
src_data
.
data_out
=
_floatBuffer48000
;
...
...
This diff is collapsed.
Click to expand it.
src/audio/codecDescriptor.cpp
+
1
−
1
View file @
f6c94459
...
...
@@ -49,7 +49,7 @@ CodecDescriptorMap::getCodec(CodecType payload)
if
(
iter
!=
_codecMap
.
end
())
{
return
(
iter
->
second
);
}
return
0
;
return
NULL
;
}
void
...
...
This diff is collapsed.
Click to expand it.
src/sipcall.cpp
+
2
−
2
View file @
f6c94459
...
...
@@ -434,7 +434,7 @@ SIPCall::sdp_complete_message(sdp_message_t * remote_sdp, osip_message_t * msg)
if
(
tmp
!=
NULL
)
{
int
payload
=
atoi
(
tmp
);
AudioCodec
*
audiocodec
=
_codecMap
.
getCodec
((
CodecType
)
payload
);
if
(
audiocodec
!=
0
&&
audiocodec
->
isActive
())
{
if
(
audiocodec
!=
NULL
&&
audiocodec
->
isActive
())
{
listCodec
<<
payload
<<
" "
;
listRtpMap
<<
"a=rtpmap:"
<<
payload
<<
" "
<<
audiocodec
->
getCodecName
()
<<
"/"
<<
audiocodec
->
getClockRate
();
if
(
audiocodec
->
getChannel
()
!=
1
)
{
...
...
@@ -658,7 +658,7 @@ SIPCall::setAudioCodecFromSDP(sdp_media_t* remote_med, int tid)
if
(
tmp
!=
NULL
)
{
int
payload
=
atoi
(
tmp
);
// stop if we find a correct codec
if
(
0
!=
_codecMap
.
getCodec
((
CodecType
)
payload
)){
if
(
_codecMap
.
getCodec
((
CodecType
)
payload
)
!=
NULL
){
break
;
}
}
...
...
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