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
7426b982
Commit
7426b982
authored
16 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
add condition on resampling for decoder (#1143)
parent
ebe38528
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/audio/audiortp.cpp
+21
-13
21 additions, 13 deletions
sflphone-common/src/audio/audiortp.cpp
with
21 additions
and
13 deletions
sflphone-common/src/audio/audiortp.cpp
+
21
−
13
View file @
7426b982
...
@@ -365,7 +365,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
...
@@ -365,7 +365,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
_debug
(
"fixed_codec_framesize: %i
\n
"
,
fixed_codec_framesize
);
_debug
(
"fixed_codec_framesize: %i
\n
"
,
fixed_codec_framesize
);
int
maxBytesToGet
=
_layerSampleRate
*
fixed_codec_framesize
*
sizeof
(
SFLDataFormat
)
/
1000
;
int
maxBytesToGet
=
_layerSampleRate
*
fixed_codec_framesize
*
sizeof
(
SFLDataFormat
)
/
1000
;
_debug
(
"maxBytesToGet %i
\n
"
,
maxBytesToGet
);
// available bytes inside ringbuffer
// available bytes inside ringbuffer
int
availBytesFromMic
=
audiolayer
->
canGetMic
();
int
availBytesFromMic
=
audiolayer
->
canGetMic
();
...
@@ -379,6 +379,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
...
@@ -379,6 +379,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
// Get bytes from micRingBuffer to data_from_mic
// Get bytes from micRingBuffer to data_from_mic
//_debug("get data from mic\n");
//_debug("get data from mic\n");
int
nbSample
=
audiolayer
->
getMic
(
micData
,
bytesAvail
)
/
sizeof
(
SFLDataFormat
);
int
nbSample
=
audiolayer
->
getMic
(
micData
,
bytesAvail
)
/
sizeof
(
SFLDataFormat
);
_debug
(
"nb of sample from mic %i
\n
"
,
nbSample
);
int
compSize
=
0
;
int
compSize
=
0
;
// test if resampling is required
// test if resampling is required
...
@@ -483,20 +484,27 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
...
@@ -483,20 +484,27 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
}
}
int
nbSample
=
nbInt16
;
int
nbSample
=
nbInt16
;
if
(
_audiocodec
->
getClockRate
()
!=
_layerSampleRate
)
{
// Do sample rate conversion
// Do sample rate conversion
int
nb_sample_down
=
nbSample
;
int
nb_sample_down
=
nbSample
;
nbSample
=
reSampleData
(
_codecSampleRate
,
nb_sample_down
,
UP_SAMPLING
);
nbSample
=
reSampleData
(
_codecSampleRate
,
nb_sample_down
,
UP_SAMPLING
);
#ifdef DATAFORMAT_IS_FLOAT
//
#ifdef DATAFORMAT_IS_FLOAT
#else
//
#else
#endif
//
#endif
// Stor the number of samples for recording
// Stor the number of samples for recording
_nSamplesSpkr
=
nbSample
;
_nSamplesSpkr
=
nbSample
;
//audiolayer->playSamples( spkrDataConverted, nbSample * sizeof(SFLDataFormat), true);
//audiolayer->playSamples( spkrDataConverted, nbSample * sizeof(SFLDataFormat), true);
audiolayer
->
putMain
(
spkrDataConverted
,
nbSample
*
sizeof
(
SFLDataFormat
));
audiolayer
->
putMain
(
spkrDataConverted
,
nbSample
*
sizeof
(
SFLDataFormat
));
}
else
{
// Stor the number of samples for recording
_nSamplesSpkr
=
nbSample
;
audiolayer
->
putMain
(
spkrDataDecoded
,
nbSample
*
sizeof
(
SFLDataFormat
));
}
// Notify (with a beep) an incoming call when there is already a call
// Notify (with a beep) an incoming call when there is already a call
countTime
+=
time
->
getSecond
();
countTime
+=
time
->
getSecond
();
...
...
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