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
5e005159
Commit
5e005159
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
audio: use av_samples_set_silence
Change-Id: Ia2f2eada788e6dd81e2442a0f384943ea3efa8ad
parent
dbba9e62
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/media/audio/audioloop.cpp
+1
-0
1 addition, 0 deletions
src/media/audio/audioloop.cpp
src/media/audio/opensl/audio_player.cpp
+1
-1
1 addition, 1 deletion
src/media/audio/opensl/audio_player.cpp
src/media/audio/opensl/audio_recorder.cpp
+1
-1
1 addition, 1 deletion
src/media/audio/opensl/audio_recorder.cpp
with
3 additions
and
2 deletions
src/media/audio/audioloop.cpp
+
1
−
0
View file @
5e005159
...
...
@@ -65,6 +65,7 @@ AudioLoop::getNext(AVFrame* output, bool mute)
if
(
buf_samples
==
0
)
{
JAMI_ERR
(
"Audio loop size is 0"
);
av_samples_set_silence
(
output
->
data
,
0
,
output
->
nb_samples
,
format_
.
nb_channels
,
format_
.
sampleFormat
);
return
;
}
else
if
(
pos
>=
buf_samples
)
{
JAMI_ERR
(
"Invalid loop position %zu"
,
pos
);
...
...
This diff is collapsed.
Click to expand it.
src/media/audio/opensl/audio_player.cpp
+
1
−
1
View file @
5e005159
...
...
@@ -168,7 +168,7 @@ AudioPlayer::AudioPlayer(jami::AudioFormat sampleFormat,
silentBuf_
=
{(
format_pcm
.
containerSize
>>
3
)
*
format_pcm
.
numChannels
*
bufSize
};
silentBuf_
.
size_
=
silentBuf_
.
cap_
;
memset
(
silentBuf_
.
buf_
,
0
,
silentBuf_
.
cap_
);
av_samples_set_silence
(
&
silentBuf_
.
buf_
,
0
,
(
int
)
bufSize
,
(
int
)
sampleInfo_
.
nb_channels
,
sampleInfo_
.
sampleFormat
);
}
AudioPlayer
::~
AudioPlayer
()
...
...
This diff is collapsed.
Click to expand it.
src/media/audio/opensl/audio_recorder.cpp
+
1
−
1
View file @
5e005159
...
...
@@ -202,7 +202,7 @@ AudioRecorder::AudioRecorder(jami::AudioFormat sampleFormat, size_t bufSize, SLE
silentBuf_
=
{(
format_pcm
.
containerSize
>>
3
)
*
format_pcm
.
numChannels
*
bufSize
};
silentBuf_
.
size_
=
silentBuf_
.
cap_
;
memset
(
silentBuf_
.
buf_
,
0
,
silentBuf_
.
cap_
);
av_samples_set_silence
(
&
silentBuf_
.
buf_
,
0
,
(
int
)
bufSize
,
(
int
)
sampleInfo_
.
nb_channels
,
sampleInfo_
.
sampleFormat
);
}
bool
...
...
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