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
4f3ccc26
Commit
4f3ccc26
authored
5 years ago
by
Ming Rui Zhang
Committed by
Sébastien Blin
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sipcall: fix the order of playbackqueue to make DTMF ring tone correct
Change-Id: Ib3755c563cb9928f25aee285510e367774d18389
parent
ff4a0ae3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/media/audio/audiolayer.cpp
+6
-10
6 additions, 10 deletions
src/media/audio/audiolayer.cpp
with
6 additions
and
10 deletions
src/media/audio/audiolayer.cpp
+
6
−
10
View file @
4f3ccc26
...
...
@@ -56,7 +56,7 @@ void AudioLayer::hardwareFormatAvailable(AudioFormat playback)
std
::
lock_guard
<
std
::
mutex
>
lock
(
mutex_
);
JAMI_DBG
(
"Hardware audio format available : %s"
,
playback
.
toString
().
c_str
());
audioFormat_
=
Manager
::
instance
().
hardwareAudioFormatChanged
(
playback
);
urgentRingBuffer_
.
setFormat
(
playback
);
urgentRingBuffer_
.
setFormat
(
audioFormat_
);
}
void
AudioLayer
::
hardwareInputFormatAvailable
(
AudioFormat
capture
)
...
...
@@ -142,13 +142,6 @@ AudioLayer::getToPlay(AudioFormat format, size_t writableSamples)
notifyIncomingCall
();
auto
&
bufferPool
=
Manager
::
instance
().
getRingBufferPool
();
if
(
auto
urgentSamples
=
urgentRingBuffer_
.
get
(
RingBufferPool
::
DEFAULT_ID
))
{
bufferPool
.
discard
(
1
,
RingBufferPool
::
DEFAULT_ID
);
return
urgentSamples
;
}
// flush remaining samples in _urgentRingBuffer
flushUrgent
();
if
(
not
playbackQueue_
)
playbackQueue_
.
reset
(
new
AudioFrameResizer
(
format
,
writableSamples
));
else
...
...
@@ -156,7 +149,10 @@ AudioLayer::getToPlay(AudioFormat format, size_t writableSamples)
std
::
shared_ptr
<
AudioFrame
>
playbackBuf
{};
while
(
!
(
playbackBuf
=
playbackQueue_
->
dequeue
()))
{
if
(
auto
toneToPlay
=
Manager
::
instance
().
getTelephoneTone
())
{
if
(
auto
urgentSamples
=
urgentRingBuffer_
.
get
(
RingBufferPool
::
DEFAULT_ID
))
{
bufferPool
.
discard
(
1
,
RingBufferPool
::
DEFAULT_ID
);
playbackQueue_
->
enqueue
(
std
::
move
(
urgentSamples
));
}
else
if
(
auto
toneToPlay
=
Manager
::
instance
().
getTelephoneTone
())
{
playbackQueue_
->
enqueue
(
resampler_
->
resample
(
toneToPlay
->
getNext
(),
format
));
}
else
if
(
auto
buf
=
bufferPool
.
getData
(
RingBufferPool
::
DEFAULT_ID
))
{
playbackQueue_
->
enqueue
(
resampler_
->
resample
(
std
::
move
(
buf
),
format
));
...
...
@@ -164,7 +160,7 @@ AudioLayer::getToPlay(AudioFormat format, size_t writableSamples)
break
;
}
}
return
playbackBuf
;
}
...
...
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