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
7ba8379d
Commit
7ba8379d
authored
13 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#5765: Fix audio crash for illformated wavefiles
parent
ae7c5c3a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/audio/audioloop.cpp
+5
-0
5 additions, 0 deletions
sflphone-common/src/audio/audioloop.cpp
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+30
-12
30 additions, 12 deletions
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
with
35 additions
and
12 deletions
sflphone-common/src/audio/audioloop.cpp
+
5
−
0
View file @
7ba8379d
...
...
@@ -53,6 +53,11 @@ AudioLoop::getNext (SFLDataFormat* output, int nb, short volume)
int
block
;
int
pos
=
_pos
;
if
(
_size
==
0
)
{
_error
(
"AudioLoop: Error: Audio loop size is 0"
);
return
0
;
}
while
(
nb
)
{
block
=
nb
;
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/audio/pulseaudio/pulselayer.cpp
+
30
−
12
View file @
7ba8379d
...
...
@@ -958,27 +958,45 @@ void PulseLayer::ringtoneToSpeaker (void)
if
(
file_tone
)
{
if
(
ringtone
->
getStreamState
()
==
PA_STREAM_READY
)
{
if
(
ringtone
->
getStreamState
()
!=
PA_STREAM_READY
)
{
_error
(
"PulseAudio: Error: Ringtone stream not in state ready"
);
return
;
}
out
=
(
SFLDataFormat
*
)
pa_xmalloc
(
writableSize
);
if
(
out
==
NULL
)
{
_error
(
"PulseAudio: Error: Could not allocate memory for buffer"
);
return
;
}
out
=
(
SFLDataFormat
*
)
pa_xmalloc
(
writableSize
);
memset
(
out
,
0
,
writableSize
);
memset
(
out
,
0
,
writableSize
);
int
copied
=
file_tone
->
getNext
(
out
,
writableSize
/
sizeof
(
SFLDataFormat
),
100
);
pa_stream_write
(
ringtone
->
pulseStream
(),
out
,
copied
*
sizeof
(
SFLDataFormat
),
NULL
,
0
,
PA_SEEK_RELATIVE
);
int
copied
=
file_tone
->
getNext
(
out
,
writableSize
/
sizeof
(
SFLDataFormat
),
100
);
pa_xfree
(
out
);
if
(
copied
==
0
)
{
copied
=
writableSize
/
sizeof
(
SFLDataFormat
);
}
}
else
{
if
(
ringtone
->
get
Stream
State
()
==
PA_STREAM_READY
)
{
pa_stream_write
(
ringtone
->
pulse
Stream
(),
out
,
copied
*
sizeof
(
SFLDataFormat
),
NULL
,
0
,
PA_SEEK_RELATIVE
);
out
=
(
SFLDataFormat
*
)
pa_xmalloc
(
writableSize
);
memset
(
out
,
0
,
writableSize
);
pa_xfree
(
out
);
}
else
{
pa_stream_write
(
ringtone
->
pulseStream
(),
out
,
writableSize
,
NULL
,
0
,
PA_SEEK_RELATIVE
);
if
(
ringtone
->
getStreamState
()
!=
PA_STREAM_READY
)
{
_error
(
"PulseAudio: Error: Ringtone stream not in state ready"
);
return
;
}
pa_xfree
(
out
);
out
=
(
SFLDataFormat
*
)
pa_xmalloc
(
writableSize
);
if
(
out
==
NULL
)
{
_error
(
"PulseAudio: Error: Could not allocate memory for buffer"
);
return
;
}
memset
(
out
,
0
,
writableSize
);
pa_stream_write
(
ringtone
->
pulseStream
(),
out
,
writableSize
,
NULL
,
0
,
PA_SEEK_RELATIVE
);
pa_xfree
(
out
);
}
...
...
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